i have a file containing UTF-16 characters. i read in the file and can store the characters either in a uint16_t array or a char array (any better choice?)
But how do i print those characters?
i have a file containing UTF-16 characters. i read in the file and can store the characters either in a uint16_t array or a char array (any better choice?)
But how do i print those characters?
I'm assuming you want to print to stdout
or stderr
. One method would be to use libiconv to convert from UTF-16 to UTF-32 (also known as UCS-4) into a wide-character string (wchar_t
). You could then use wprintf
and friends to print to the standard streams.
© 2022 - 2024 — McMap. All rights reserved.