[wp-trac] [WordPress Trac] #40560: REST API: Unicode characters are escaped in the response

WordPress Trac noreply at wordpress.org
Thu Mar 15 02:04:40 UTC 2018


#40560: REST API: Unicode characters are escaped in the response
--------------------------+-----------------------
 Reporter:  rilwis        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  REST API      |     Version:  4.7
 Severity:  normal        |  Resolution:  invalid
 Keywords:  close         |     Focuses:  rest-api
--------------------------+-----------------------

Comment (by rmccue):

 There are two separate parts really: valid characters, and normalisation.
 As §7 notes:

 > All Unicode characters may be placed within the quotation marks, except
 for the characters that MUST be escaped: quotation mark, reverse solidus,
 and the control characters (U+0000 through U+001F).

 That is, all characters except for those characters are '''valid'''.
 However, the spec also notes:

 > Any character may be escaped.

 The normalisation part is covered in
 [https://tools.ietf.org/html/rfc8259#section-8.3 §8.3 (String
 Comparison)].

 If any character apart from the characters is escaped, that's still valid
 JSON, it's simply denormalised. Your JSON parser should be normalising
 this data when it is parsed out.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40560#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list