#1995: expose('json') encodes, but does not set coding in Content-Type header
---------------------------------+------------------------------------------
Reporter: PeterRussell | Owner: faide
Type: defect | Status: closed
Priority: normal | Milestone: 1.1
Component: TurboGears | Version: 1.0.7
Severity: minor | Resolution: fixed
Keywords: unicode json expose |
---------------------------------+------------------------------------------
Changes (by chrisz):
* status: new => closed
* resolution: => fixed
* severity: major => minor
Comment:
Thanks for submitting the patch. Your observation is right, but I believe
this is expected behavior that should not be changed.
Since the default encoding for JSON (application/json) is in fact utf-8,
this encoding does not need to be specified in the header by adding an
additional charset parameter. (Optionally, you can also use utf-16 or
utf-32 instead of utf-8, but even then you don't need to specify which of
these encodings is used since it is clear from looking at the first 4
bytes.)
See http://www.ietf.org/rfc/rfc4627.txt for the exact specs.
Particularly notice that section 6 says that there are no
required/optional parameters for application/json (i.e. particularly, no
"charset"). This is different from application/xhtml+xml, where charset is
an optional parameter (but also not required).
Please reopen if you think I'm misinterpreting the rfc or the rfc should
not be taken seriously for whatever pragmatic reason (in this case, please
explain where the current implementation will cause problems).
--
Ticket URL: <http://trac.turbogears.org/ticket/1995#comment:1>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---