[New-bugs-announce] [issue33684] parse failed for mutibytes characters, encode will show in \xxx

zhou.ronghua report at bugs.python.org
Tue May 29 10:29:39 EDT 2018


New submission from zhou.ronghua <zhou.ronghua at zte.com.cn>:

when type this command in windows(xp or win7, all the same):
python -m json.tool xxx.txt xxx.json
if xxx.txt contains Chinese(or other multibytes characters):
if xxx.txt is encoded in ansi, xxx.json will encode Chinese as \xxx, very bad to see what they are;
if xxx.txt is encoded in utf8(without bom for most of the time), because with no bom, json.tool will think it is encoded in ansi, and decode fail.

as now, utf8 is widely use, set default to utf8 for most of the time when auto detect encoding failed

----------
messages: 318039
nosy: zhou.ronghua
priority: normal
severity: normal
status: open
title: parse failed for mutibytes characters, encode will show in \xxx

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33684>
_______________________________________


More information about the New-bugs-announce mailing list