Opened 8 years ago

Closed 3 years ago

#6234 closed Bug (fixed)

Serialization with JSON and UTF-8, "ensure_ascii=False" invalid now?

Reported by: aaron@… Owned by: nobody
Component: Core (Serialization) Version: 1.2
Severity: Normal Keywords: json ensure_ascii utf-8 utf8
Cc: mofle Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The bottom of page:

says for JSON you should specify:

This appears not to be the case, as latest trunk actually generates an exception when a unicode character is hit with "ensure_ascii=False". This seems to be two problems depending on your perspective, but I'm not sure how to tackle this.
(1) Removing the ensure_ascii parameter allows the serializer to generate UTF-8 encoded characters. (consequence of UTF-8 branch merge?)
(2) Documentation tells you to do something that actually generates an exception.

Change History (8)

comment:1 Changed 8 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I just ran into this one myself. Removing ensure_ascii=False seems to have fixed my problem. The docs need to be updated...

comment:2 Changed 8 years ago by anonymous

I've found this to be true also. The docs need to be updated or the the trunk needs to be patched. This is really confusing...! E

comment:3 Changed 7 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 6 years ago by roklenardic

  • Version changed from SVN to 1.2

This bug still happens in the latest 1.2 release of Django. Another user asked for help here a long time ago:

Simply omitting ensure_ascii parameter resolves the issue even though it makes no sense. Having ensure_ascii=False should properly deal with unicode characters, after all, that is what this parameter is for.


comment:5 Changed 5 years ago by julien

  • Severity set to Normal
  • Type set to Bug

comment:6 Changed 5 years ago by mofle

  • Cc mofle added
  • Easy pickings unset

Can someone update the docs? I got into the same problem too.

comment:7 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:8 Changed 3 years ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top