问题
I'm searching a long time to find a method to convert a NON-LATIN String to upper and/or lowewr case. Cyrillic-, Greek- and co. Writing Systems. So in other words: Convert all characters that support upper/lower case to upper or lower.
NOTE: QString from the Qt Framework supports this feature. But I'm searching for a non-Qt solution.
I tried this piece of code, and it only supports Basic-Latin (a-z, A-Z) neither Á â ş Ş ȧ Ȧ etc. are supported. (???) Why so minimalistic?
#include <iostream>
#include <string>
#include <algorithm>
#include <boost/algorithm/string.hpp>
using std::cout;
using std::cerr;
using std::endl;
using std::cin;
typedef std::string string;
static string text;
int main(void)
{
cout << "Enter String: ";
cin >> text;
for (size_t i = 0; i < text.length(); i++)
text[i] = std::toupper(text.at(i));
cout << "Upper Case (libstdc++): " << text << endl;
cout << "Upper Case (libboost): " << boost::to_upper_copy(text) << endl;
}
I downloaded the Qt Source Code, but for me as hobby developer I'm unable to find the QString implementations to see whats going on here. And why it supports just ALL.
Is there probably a std or boost way to convert toupper or tolower all these characters that supports it?
A 3th-party library would be ok too.
PS: Sorry for my English.
来源:https://stackoverflow.com/questions/19657894/how-to-convert-string-toupper-tolower-case-unicode-is-a-must-cyrillic-greek