Making WordPress.org

Opened 8 years ago

Closed 5 years ago

#1748 closed defect (bug) (worksforme)

utf8 encoding for json outputs

Reported by: dd32's profile 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 (3)

#1 @tellyworth
7 years ago

  • Keywords 2nd-opinion added

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

#3 @dd32
5 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

I'm going to close this off - Either it's a problem still and hasn't been reported in a long time, or it's been fixed..

Note: See TracTickets for help on using tickets.