Discuss / Python / 作业

作业

Topic source

青铜神裔

#1 Created at ... [Delete] [Delete and Lock User]

通过help(json.dumps),对于参数ensure_ascii解释:

If ensure_ascii is false, then the return value can contain non-ASCII characters if they appear in strings contained in obj. Otherwise, all such characters are escaped in JSON strings.

unicode编码包含ascii编码 没有设置ensure_ascii = False的话就默认将汉字转为unicode编码


  • 1

Reply