toupper/tolower + locale (german)
- by Oops
Hi,
how to convert a string (wstring) from lowercase to uppercase characters and vice versa?
I searched the net and found there is a STL-function std::transform.
But until now I hav'nt figured out how to give the right locale-object for example "Germany_german" to the function.
Who can help please?
my code looks like:
wstring strin = L"ABCÄÖÜabcäöü";
wstring str = strin;
locale loc( "Germany_german" ); // ??? how to apply this ???
std::transform( str.begin(), str.end(), str.begin(), (int(*)(int)tolower );
//result: "abcäöüabcäöü"
The characters ÄÖÜ and äöü (it's like Ae, Oe, Ue) will not be converted correctly.
P.S.: I don't prefer a big switch sweat and also I know BOOST is capable of everything, i would prefer a STL solution.
thanks in advance
Oops