boostorg/locale

Confused with the expected behavior regarding the capitalization of “ß”

Closed this issue · 4 comments

This example (https://www.boost.org/doc/libs/1_71_0/libs/locale/doc/html/conversions.html) indicates that the correct case for the word "grüßen" is as follow:

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

However, the wording used in the example examples/conversions.cpp seems to indicate that replacing ß by SS is incorrect when using uppercase :

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;

I tried running this example (note that I used Boost 1.71), and this is the result I get:

For example:
   German grüßen correctly converted to GRÜßEN, instead of incorrect GRüßEN
     where ß is replaced with SS

...and now I'm even more confused. What is the actual expected behavior for this case?

Make sure boost.locale is compiled with ICU. conversion of ß to SS supported only in ICU backend

Independently of the result I get by compiling on my machine, could you clarify the discrepancy between the documentation and the example in the code?

Independently of the result I get by compiling on my machine, could you clarify the discrepancy between the documentation and the example in the code?

I see the source of the confusion. The part "where ß is replaced with SS" refers to the correct, i.e. expected behavior.

Fixing the example to read:

German grüßen would be incorrectly converted to GRÜßEN, while Boost.Locale converts it to GRÜSSEN
where ß is replaced with SS.

I hope that's easier to understand.

This is much more clear, thanks.