Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
olivier-grech opened this issue Jan 10, 2020 · 4 comments · Fixed by #151
Closed

Comments

@olivier-grech
Copy link

olivier-grech commented Jan 10, 2020

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?

@artyom-beilis
Copy link
Member

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

@olivier-grech
Copy link
Author

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?

Flamefire added a commit to Flamefire/locale that referenced this issue Mar 5, 2023
Make it clear which output is from Boost.Locale and what is the expected
behavior by changing the order.
Also check for ICU support as only ICU is able to do that conversion.

Closes boostorg#51
Flamefire added a commit to Flamefire/locale that referenced this issue Mar 5, 2023
Make it clear which output is from Boost.Locale and what is the expected
behavior by changing the order.
Also check for ICU support as only ICU is able to do that conversion.

Closes boostorg#51
@Flamefire
Copy link
Collaborator

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.

@Flamefire Flamefire changed the title Confused with the excepted behavior regarding the capitalization of “ß” Confused with the expected behavior regarding the capitalization of “ß” Mar 5, 2023
Flamefire added a commit to Flamefire/locale that referenced this issue Mar 5, 2023
Make it clear which output is from Boost.Locale and what is the expected
behavior by changing the order.
Also check for ICU support as only ICU is able to do that conversion.

Closes boostorg#51
Flamefire added a commit that referenced this issue Mar 6, 2023
Make it clear which output is from Boost.Locale and what is the expected
behavior by changing the order.
Also check for ICU support as only ICU is able to do that conversion.

Closes #51
@olivier-grech
Copy link
Author

This is much more clear, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants