Reputation: 51283
Could somebody explain how the following example works?
I don't understand how this can work without using boost::locale::to_upper instead of boost::to_upper?
Will boost::to_upper use locale::global? I thought the regular facet/locale stuff couldn't support utf-8 since it works on character basis?
EDIT:
Also is gen("UTF-8") valid?
Furthermore, how does boost::locale work with boost::regex, is boost::32regex still needed to work with utf-8 strings?
Upvotes: 1
Views: 824
Reputation: 154015
There are two uses of to_upper()
in this example:
to_upper("grüßen")
which is resolved via the using declaration using namespace boost::locale
. This is said to produce the correct result, i.e. GRÜSSEN
.boost::to_upper_copy(std::string("grüßen"))
which seems to be the version you are referring to as "boost::to_upper". This is said to produce the incorrect result, i.e. GRÜßEN
.It seems that the root cause of your misunderstanding was that you assumed that "boost::to_upper" does the right things while it is actually meant to do the wrong thing.
Upvotes: 2