String^ UTF8ToString( const char *s ) {
int len = strlen(s);
cli::array
int i = len;
while (i-- > 0) {
a[i] = s[i];
}
return System::Text::Encoding::UTF8->GetString(a);
};
std::string StringToUTF8( String ^ s) {
System::Text::UTF8Encoding^ utf8 = gcnew System::Text::UTF8Encoding;
array
std::string os="";
for (int i=0;i
os+=encodedBytes[i];
}
return os;
}
Useful to work with other libs working in UTF-8 like sqlite...
Aucun commentaire:
Enregistrer un commentaire