pdcurses:为什么不能为汉字工作?
我正在使用GBK代码在Visual Studio上学习PDCURSES,当我使用printw(),addstr()和addwstr()打印中文字符时,它显示出乱七八糟的内容。我刚刚测试了这三个功能,但我认为所有这些印刷功能都不适用于中文。也许UTF-8会起作用(因为Visual Studio不能很好地适合UTF-8)?
I'm learning pdcurses on visual studio with GBK code, and it shows garbled when I use printw(), addstr() and addwstr() to print Chinese characters. I just tested the three functions, but I think all these printing functions won't work for Chinese. Maybe UTF-8 will work(I don't test that because visual studio can not fit UTF-8 well)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道该怎么做。
首先,我将pdcurs.dll编写为“ wide = y dll = y”选项,因为我认为汉字是宽阔的夏娃式。在这种情况下,GBK和UTF-8都不适用于中文。然后,我添加了“ UTF8 = Y”,结果得到改进:使用UTF-8到代码时,它可以显示正确的汉字,尽管它放置了汉字,该字符是较宽的纸张,并且是两个英语字母的长度,以一个英文字母的大小,这使它变得完全混乱。因此,我只是扔掉“ wide = y”和“ utf8 = y”,然后获得正确的结果。真的很烦人。
I know how to do.
At first I compiled the pdcurses.dll with "WIDE=Y DLL=Y" option, as I thought Chinese characters are wide charcaters. In this case neither GBK nor UTF-8 will work for Chinese. Then I added "UTF8=Y" when making, the result was improved: when using UTF-8 to code, it can show right Chinese characters, though it puts a Chinese character, which is wide charcter and is the length of two English letters, in the size of one English letter, which makes it complete mess. So I just throw away "WIDE=Y" and "UTF8=Y" and then get the correct result. Really annoying.