How to Print UTF-16 Characters in C?

不打扰是莪最后的温柔 提交于 2019-12-12 11:12:58

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/8315686/how-to-print-utf-16-characters-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!