Hi,
I have a problem with the tolower function. I use Netbeans 6.5 with GCC C++ on Ubuntu 64bit. The problem is, that I use nordic letters like å, ä and ö and the tolower function does not affect them at all. I have tried almost everything. I have tried to replace char by char, like this:
for(unsigned int i = 0; i < strToConvert.length(); i++)
{
if (strToConvert[i] == 'Ö')
strToConvert[i] = 'ö';
else
strToConvert[i] = tolower(strToConvert[i]);
}
return strToConvert;//return the converted string
This won't work! I have also tried to use wstring and transform but no luck. Setting the locale does nothing. I'm prepared to write a custom function, I just need some ideas on how to get around this.
Also, if I print the codes for the letters with:
string str = "ÅÄÖRNS" //an example
for (int i = 0; i < str.length(); i++) {
cout << (int) str[i] << endl;
}
'r' will print 114, 'a' 97 as expected. But 'Ö' for example will print two number: -61 and -106, 'Ä' prints -61 and -124. What's up with that?
Thanks,
Mattias