且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

打印希伯来语 UTF-8 会产生乱码

更新时间:2023-11-27 19:10:58

您只需要使用 utf8 编码将字节解码回 unicode ......默认情况下,它使用您的终端正在使用的任何东西(可能是 latin1)......您的终端可能不支持所有字符 *(参见 https://repl.it/回复/OnlyRewardingKeyboard 宏)

you just need to decode the bytes back into unicode with utf8 encoding ... by default its using whatever your terminal is using(probably latin1) ... your terminal may not support all of the characters * (see https://repl.it/repls/OnlyRewardingKeyboardmacro)

print '\xd7\xaa\xd7\x99\xd7\x9b\xd7\x95\xd7\x9f \xd7\x93\xd7\x94 \xd7\xa9\xd7\x9c\xd7\x99\xd7\x98'.decode('utf8')