[wp-trac] [WordPress Trac] #11034: AJAX responses stored as UTF-8 even if a non-UTF-8 charset is in use

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 26 11:21:09 UTC 2009


#11034: AJAX responses stored as UTF-8 even if a non-UTF-8 charset is in use
--------------------------+-------------------------------------------------
 Reporter:  iansealy      |       Owner:  azaozz    
     Type:  defect (bug)  |      Status:  new       
 Priority:  low           |   Milestone:  Unassigned
Component:  Autosave      |     Version:  2.8.5     
 Severity:  normal        |    Keywords:  AJAX UTF-8
--------------------------+-------------------------------------------------
 AJAX responses are always sent in UTF-8. If a blog is using a non-UTF-8
 charset then the data will potentially be stored incorrectly and any text
 will often end up garbled.

 For example, if your blog uses ISO-8859-1 and some text submitted via AJAX
 contains non-ASCII characters then they'll be stored in the database as
 UTF-8 double bytes rather than their ISO-8859-1 single byte equivalents.
 Since these characters will be displayed as if they're ISO-8859-1 you'll
 just end up seeing garbage.

 The attached hack simply converts all AJAX responses from UTF-8 to the
 blog's charset using iconv.

 I've put this as low priority since most blogs probably use UTF-8. I've
 also put this in the Autosave component, but obviously all AJAX responses
 are affected.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11034>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list