How to print UTF-8 characters on console using C

两盒软妹~` 提交于 2021-01-27 05:46:23

问题


I have a C application where I receive a UTF-8 string aover a socket as a char*. Now I want to print it on the console using Eclipse CDT. How can I do this? What I get is usually something like "Günther" what should be "Günther"

Thanks a lot.


回答1:


The best answer given above was by Joachim Isaksson. Thank you, this ideed seems to be the problem. I solved it in Eclipse by setting the "Encoding" settings for the run configuration to UTF-8.

enter image description hereenter image description here



来源:https://stackoverflow.com/questions/14802845/how-to-print-utf-8-characters-on-console-using-c

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