WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 10 months ago

#1748 closed defect (worksforme)

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 (3)

#1 @tellyworth
3 years ago

  • Keywords 2nd-opinion added

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