You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parse failed for mutibytes characters, encode will show in \xxx #77865
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-12-04.10:27:07.562>created_at=<Date2018-05-29.14:29:39.270>labels= ['3.7', '3.8', 'type-bug', 'library', '3.9']
title='parse failed for mutibytes characters, encode will show in \\xxx'updated_at=<Date2019-12-04.10:27:17.745>user='https://github.com/zhouronghuaztecomcn'
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
Activity
zhouronghuaztecomcn commentedon May 29, 2018
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
methane commentedon Dec 4, 2019
New changeset 808769f by Inada Naoki in branch 'master':
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
808769f
miss-islington commentedon Dec 4, 2019
New changeset a75cad4 by Miss Islington (bot) in branch '3.8':
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
a75cad4
methane commentedon Dec 4, 2019
New changeset e0f148e by Inada Naoki in branch '3.7':
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
e0f148e