search

Home  >  Q&A  >  body text

c++ - 这种编码如何转换成汉字

\u60a8\u7684\u8d26\u6237\u6ca1\u6709\u8bbe\u7f6e\u624b\u673a\u53f7\u7801\u6216\u672a\u901a\u8fc7\u624b\u673a\u9a8c\u8bc1\uff0c\u4e0d\u80fd\u4f7f\u7528\u6b64\u529f\u80fd

请问,以上编码是什么编码,如何识别呢?在VC中如何转换成汉字呢?

天蓬老师天蓬老师2803 days ago2250

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 11:13:58

    The easiest way to convert is with JavaScript:

    unescape('u60a8u7684u8d26u6237u6ca1u6709u8bbeu7f6eu624bu673au53f7u7801u6216u672au901au8fc7u624bu673au9a8cu8bc1uff0cu4e0du80fdu4f7fu7528u6b64u529fu80fd')

    As for the implementation of C , please refer to

    http://www.qingfengju.com/article.asp?id=245

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 11:13:58

    pi@rpi ~ $ python3
    Python 3.2.3 (default, Mar  1 2013, 11:53:50)
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> # console and ssh connection encoding is utf-8
    >>> s='\u60a8\u7684\u8d26\u6237\u6ca1\u6709\u8bbe\u7f6e\u624b\u673a\u53f7\u7801\u6216\u672a\u901a\u8fc7\u624b\u673a\u9a8c\u8bc1\uff0c\u4e0d\u80fd\u4f7f\u7528\u6b64\u529f\u80fd'
    >>> s
    '您的账户没有设置手机号码或未通过手机验证,不能使用此功能'
    

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:13:58

    For temporary use, I like to use this command:

    >>> echo '\u60a8\u7684\u8d26\u6237\u6ca1\u6709\u8bbe\u7f6e\u624b\u673a\u53f7\u7801\u6216\u672a\u901a\u8fc7\u624b\u673a\u9a8c\u8bc1\uff0c\u4e0d\u80fd\u4f7f\u7528\u6b64\u529f\u80fd' | ascii2uni -qaU
    您的账户没有设置手机号码或未通过手机验证,不能使用此功能
    

    reply
    0
  • Cancelreply