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
  • 380,411
  • 33
  • 383
  • 585
Searene
  • 22,811
  • 37
  • 122
  • 172

0 Answers0