阅读背景:

python3打印unicode到windows xp控制台编码cp437。

来源:互联网 

Ok, i want to print a string in my windows xp console. There are several characters the console cant print, so i have to encode to my stdout.encoding which is 'cp437'. but printing the encoded string, the 'ß' is printed as '\xe1'. after decoding back to unicode and printing the string, i get the output i want. but this feels somewhat wrong. how is the correct way to print a string and get ? for non-printable characters?Ok, i want to print a string in my windows xp c




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: