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?