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

WordPress Trac noreply at wordpress.org
Mon May 8 11:01:09 UTC 2017


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

Comment (by lovelucy):

 I have encountered this one too. In my use case, there's a translation
 service to translate my blog into another language. WordPress API output
 uses "\u" representation for UTF-8 characters, which fails my translation
 service.

 Since the encoding "UTF-8" is announced via "Content-Encoding" charset, we
 can safely output non-"\u" representations. In fact, I found that the
 legacy [https://wordpress.org/plugins/json-api/ JSON_API plugin] supports
 output-modifying arguments

 > Setting json_unescaped_unicode will replace unicode-escaped characters
 with their unescaped equivalents (e.g., \u00e1 becomes á)

 Hope there's someone who can patch this. Thanks :)

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


More information about the wp-trac mailing list