WordPress.org

Making WordPress.org

Opened 19 months ago

Last modified 5 weeks ago

#1748 new defect

utf8 encoding for json outputs

Reported by: dd32 Owned by:
Milestone: Priority: normal
Component: Plugin Directory Keywords: 2nd-opinion
Cc:

Description

WordPress includes a wp_json_encode() method for dealing with non-UTF8 strings before passing them to json_encode().

The standalone API handler doesn't have this available to it, and as such, doesn't handle JSON outputs for data containing non-utf8 data (which often occur within readme's and reviews).

I would suggest we should just borrow wp_json_encode() and namespace it appropriately, or we could alternatively include a compat file for stand-alone instances when WordPress hasn't been included.

Change History (2)

#1 @tellyworth
7 weeks ago

  • Keywords 2nd-opinion added

#2 @dd32
5 weeks ago

Does anyone have any examples of plugins whose JSON has invalid UTF8 characters?

Sorry for not including a link to one when I opened this ticket..

Note: See TracTickets for help on using tickets.