std::string ASCIIToUTF8(std::string str) {
return str;
}
Each ASCII character has the same representation in UTF8, so there is nothing to convert. Of course, if the input string uses an extended (8-bit) ASCII character set, the answer is more complex.
source
share