Opened 4 years ago

Last modified 4 years ago

#32080 closed Bug

admin can't display Chinese normally when a JsonField contains Chinese — at Version 1

Reported by: ZhaoQi99 Owned by: nobody
Component: Forms Version: 3.1
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description (last modified by ZhaoQi99)

>>> import json
>>> print json.dumps('中国')
"\u4e2d\u56fd"

json.dumps use ASCII encoding by default when serializing Chinese.
So when we edit a JsonField which contains Chinese character in Django admin,it will appear in ASCII characters.

https://user-images.githubusercontent.com/25344334/95312376-6fa92b00-08c1-11eb-9b48-3c5e14683e9c.png
https://user-images.githubusercontent.com/25344334/95312742-e0504780-08c1-11eb-82af-116b8f2e158a.png

I have try to fix this this problem in https://github.com/adamchainz/django-mysql/pull/714.And it works prefectly.

Change History (1)

comment:1 by ZhaoQi99, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top