84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
查找了ord和chr这类,没有搞定。想用python把"\u5b57\u7b26\u7f16\u7801"转为汉字字符串。
"\u5b57\u7b26\u7f16\u7801"
认证高级PHP讲师
print string.encode('utf8')
This is Unicode
The answer is as follows:
#!/usr/bin/env python3 # -*- coding:utf-8 -*- str = "\u53ef\u8f6c\u51fa\u91d1\u989d\u8d85\u9650" str.encode('utf8') print(str)
This is unicode, you need u"u5b57u7b26u7f16u7801", print is Chinese, character encoding
This is Unicode
The answer is as follows:
This is unicode, you need u"u5b57u7b26u7f16u7801", print is Chinese, character encoding