2008-12-21, 04:49
Hi all,
I have a stupid question: how to make a CStdString(W) lowercase?
Initially I have an UTF-8 Cyrillic string in CStdString. It shows fine both in karaoke lyrics and in logs. But so far any attempt to make it lowercase failed.
1. The most obvious way
prints the same uppercase string. Using CStdStringW surprisingly doesn't help either:
Again returns the same string as above. How to properly lowercase a non-English utf8 string in XBMC?
P.S. I use Linux.
I have a stupid question: how to make a CStdString(W) lowercase?
Initially I have an UTF-8 Cyrillic string in CStdString. It shows fine both in karaoke lyrics and in logs. But so far any attempt to make it lowercase failed.
1. The most obvious way
Code:
CStdString lower = m_lyrics[i].text;
lower.ToLower();
lower.MakeLower(); // no idea which to use
CLog::Log(LOGERROR, "lower %s", lower.c_str());
prints the same uppercase string. Using CStdStringW surprisingly doesn't help either:
Code:
CStdStringW temptext;
g_charsetConverter.utf8ToW( m_lyrics[i].text, temptext );
CStdStringW lowertext = temptext;
lowertext.ToLower();
lowertext.MakeLower();
CStdString lower;
g_charsetConverter.wToUTF8( lowertext, lower );
Again returns the same string as above. How to properly lowercase a non-English utf8 string in XBMC?
P.S. I use Linux.