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

WordPress Trac noreply at wordpress.org
Tue Jul 23 10:30:02 UTC 2019


#40560: REST API: Unicode characters are escaped in the response
--------------------------+-----------------------
 Reporter:  rilwis        |       Owner:  (none)
     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 coeing):

 Hey there,

 I totally understand your argumentation on this issue. And from a pure
 technical view it doesn't matter at all if the characters are encoded or
 not.

 Unfortunately there are some not-so-technical clients out there for whom
 the JSON looks like an error with those escaped characters.

 As the reporter @rilwis already pointed out: Since PHP 5.3 there is the
 option `JSON_UNESCAPED_UNICODE`. And the Wordpress function
 `wp_json_encode` also accepts options to be passed to `json_encode`. So it
 would be great to just have the possibility to set those options which the
 `WP_REST_Server` will use in its `serve_request` method :) Even a filter
 would be enough for those purposes.

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


More information about the wp-trac mailing list