Confused by boost::locale's capitalization of "ß"?

Issue with boost::locale Uppercase Conversion of “ß”

I am using the boost::locale library in version 1.71 to convert strings to uppercase and lowercase, but I am having issues with the capitalization of “ß”. According to the documentation, the letter “ß” should be capitalized to “SS” when using the uppercase method. However, this is not the case when I try it in my code.

For example, the following example from the documentation:

Upper GRÜSSEN
Lower grüßen
Title Grüßen
Fold grüssen

When I use the same method in my code, the “ß” remains as “ß”.

I am confused and have provided an example from the boost::locale library source for reference:

//
//  Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
//  Distributed under the Boost Software License, Version 1.0. (See
//  accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/locale.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <iostream>

#include <ctime>



int main()
{
    using namespace boost::locale;
    using namespace std;
    // Create system default locale
    generator gen;
    locale loc=gen(""); 
    locale::global(loc); 
    cout.imbue(loc);

    
    cout<<"Correct case conversion can't be done by simple, character by character conversion"<<endl;
    cout<<"because case conversion is context sensitive and not 1-to-1 conversion"<<endl;
    cout<<"For example:"<<endl;
    cout<<"   German grüßen correctly converted to "<<to_upper("grüßen")<<", instead of incorrect "
                    <<boost::to_upper_copy(std::string("grüßen"))<<endl;
    cout<<"     where ß is replaced with SS"<<endl;
    cout<<"   Greek ὈΔΥΣΣΕΎΣ is correctly converted to "<<to_lower("ὈΔΥΣΣΕΎΣ")<<", instead of incorrect "
                    <<boost::to_lower_copy(std::string("ὈΔΥΣΣΕΎΣ"))<<endl;
    cout<<"     where Σ is converted to σ or to ς, according to position in the word"<<endl;
    cout<<"Such type of conversion just can't be done using std::toupper that work on character base, also std::toupper is "<<endl;
    cout<<"not even applicable when working with variable character length like in UTF-8 or UTF-16 limiting the correct "<<endl;
    cout<<"behavior to unicode subset BMP or ASCII only"<<endl;
   
}

// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4

// boostinspect:noascii

This is the result I get when I compile it:

Correct case conversion can't be done by simple, character by character conversion
because case conversion is context sensitive and not 1-to-1 conversion
For example:
   German grüßen correctly converted to GRÜßEN, instead of incorrect GRüßEN
     where ß is replaced with SS
   Greek ὈΔΥΣΣΕΎΣ is correctly converted to ὀδυσσεύσ, instead of incorrect ὈΔΥΣΣΕΎΣ
     where Σ is converted to σ or to ς, according to position in the word
Such type of conversion just can't be done using std::toupper that work on character base, also std::toupper is 
not even applicable when working with variable character length like in UTF-8 or UTF-16 limiting the correct 
behavior to unicode subset BMP or ASCII only

The expected behavior is that the letter “ß” should be capitalized to “SS”.

According to the documentation, when using the boost::locale library to convert strings to uppercase, the letter “ß” should be capitalized to “SS”. However, it seems that this is not happening in your code. The example code you provided from the boost::locale library source correctly converts “grüßen” to “GRÜßEN” with the letter “ß” being capitalized to “SS”. Therefore, you may need to check your code and ensure that you are using the correct version of the library and that your code is correctly calling the uppercase conversion function.