0

I have a file encoded in UTF16LE(UTF-16 little endian), I want to read this file and store its contents in a string encoded in UTF-8.

int main() {
  vector<char> utf16le_chars = read_file("/tmp/utf16.txt");
  string utf8_string = to_utf8(utf16le_chars);
}

How to implement the to_utf8 function?

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
Searene
  • 25,920
  • 39
  • 129
  • 186

0 Answers0