上标的 Unicode 字符显示一个方框: ࠚ
使用以下代码创建 Unicode 字符串:
wchar_t HELLO[20];
wsprintf(HELLO, TEXT("%c"), 0x2074);
当我将其显示到 Win32 控件(如文本框或按钮)上时,它会映射到 [] 方块。 我该如何解决这个问题? 我尝试使用 Eclipse(MinGW) 和 Microsoft Visual C++ (2010) 进行编译。 另外,UNICODE 在顶部定义
编辑:
我认为这可能与我的系统有关,因为当我访问:http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts 某些 unicode 字符不会出现。
Using the following code to create a Unicode string:
wchar_t HELLO[20];
wsprintf(HELLO, TEXT("%c"), 0x2074);
When I display this onto a Win32 Control like a Text box or a button it gets mapped to a [] Square.
How do I fix this ?
I tried compiling with both Eclipse(MinGW) and Microsoft Visual C++ (2010).
Also, UNICODE is defined at the top
Edit:
I think it might be something to do with my system, because when I visit: http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts
some of the unicode characters don't appear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您从维基百科获得的字符以十六进制表示,因此您的代码应该是:
如果仍然不起作用,则这是字体问题;如果您需要泛 Unicode 字体,Code2000 似乎是最完整的字体之一。
有趣的事实:具有十进制代码2074(即十六进制81a)的字符
似乎实际上是一个盒子(或者它是一个奇怪的野兽,甚至 FileFormat.Info 中的图像轮廓也是如此错误)。 :)对于好奇的人:事实证明 0x081a 就是这个东西:
The characters you are getting from Wikipedia are expressed in hexadecimal, so your code should be:
If it still doesn't work, it's a font problem; if you need a pan-Unicode font, it seems that Code2000 is one of the most complete out there.
Funny fact: the character that has the decimal code 2074 (i.e. hex 81a)
seems to actually be a box (orit's such a strange beast that even the image outline at FileFormat.Info is wrong). :)For the curious ones: it turns out that 0x081a is this thing:
您使用的字体不包含该字符的字形。您可能需要安装一些新字体来克服这个缺陷。
您选择的字符是“SAMARITAN MODIFIER LETTER EPENTHETIC YUT”(U+081A)。也许您在寻找 U+2074,即“SUPERSCRIPT 4”(U+2074)。您需要十六进制:0x2074。
请注意,您将问题更改为
0x2074
,但原始版本为2074
。无论哪种方式,如果您看到一个框,表明您的字体缺少该字形。The font you are using does not contain a glyph for that character. You will likely need to install some new fonts to overcome this deficiency.
The character you have picked out is 'SAMARITAN MODIFIER LETTER EPENTHETIC YUT' (U+081A). Perhaps you were after U+2074, i.e. 'SUPERSCRIPT FOUR' (U+2074). You need hex for that: 0x2074.
Note you changed the question to read
0x2074
but the original version read2074
. Either way, if you see a box that indicates your font is missing that glyph.