printf UTF8 字符与 printf 来自十六进制整数
有点微不足道的事情,但是... 十六进制纯 C 打印日语字符
我想使用来自 此表,我知道,表中的第一个字符,あ的实体是ぁ,其十六进制实体是x3041等。
但是我如何使用这两个数字来打印命令行中的所有字符?
Kind of trivial thing but ...
I want to print japanese characters using plain C from Hexadecimals
From this table, I know that, the first char in the table, あ's Entity is 12353 and its Hex Entity is x3041, etc.
But how do I use this two numbers in order to get printed all characters in the command line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你的终端设置为UTF-8并且语言环境设置正确,你可以这样写:
你也可以尝试
(最后是“あ”的Unicode UTF-8编码),然后只需
printf("%s “,s);
If your terminal is set to UTF-8 and locale is set correctly, you may write:
you can also try
(the last is the Unicode UTF-8 encoding for "あ"), and then just
printf("%s",s);
如果定义了 __STDC_ISO_10646__,则
wchar_t
采用 Unicode,您可以执行以下操作:If
__STDC_ISO_10646__
is defined,wchar_t
is in Unicode, and you can do something like: