如何使用C在控制台上打印UTF-8字符 [英] How to print UTF-8 characters on console using C
本文介绍了如何使用C在控制台上打印UTF-8字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个C应用程序,在该应用程序中,我在套接字上以字符*的形式接收了UTF-8字符串.现在,我想使用Eclipse CDT在控制台上打印它.我怎样才能做到这一点?我得到的通常是Günther"之类的东西,应该是Günther"
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"
非常感谢.
推荐答案
上面给出的最佳答案是Joachim Isaksson.谢谢,这个想法似乎是问题所在.我通过在Eclipse中将运行配置的编码"设置设置为UTF-8来解决了这个问题.
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.
这篇关于如何使用C在控制台上打印UTF-8字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文