pdcurses:为什么不能为汉字工作?

发布于 2025-01-21 10:37:25 字数 167 浏览 2 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨巷深深 2025-01-28 10:37:25

我知道该怎么做。
首先,我将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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文