Making WordPress.org

Opened 4 years ago

Last modified 2 years ago

#1748 new defect

utf8 encoding for json outputs

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


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
2 years ago

  • Keywords 2nd-opinion added

#2 @dd32
2 years 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.