[wp-trac] [WordPress Trac] #6607: RSS widget doesn't correct the target encoding

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 6 02:49:13 GMT 2008


#6607: RSS widget doesn't correct the target encoding
-----------------------+----------------------------------------------------
 Reporter:  guillep2k  |       Owner:  anonymous
     Type:  defect     |      Status:  new      
 Priority:  normal     |   Milestone:  2.7      
Component:  General    |     Version:  2.6      
 Severity:  normal     |    Keywords:           
-----------------------+----------------------------------------------------
 When your blog is iso-8859-1 and your RSS widget takes information from an
 UTF-8 blog, the characters in your page can become garbled. The reverse is
 also true (your blog is UTF-8 and the RSS'd blog is ISO-8859-1). Here's my
 proposal for wp-includes/rss.php (around line 62):


 {{{
                 $this->parser = $parser;

 #MODIFICATIONS BEGIN
 switch( @strtoupper(get_option('blog_charset')) )
 {
         case 'UTF-8':
                 xml_parser_set_option( $this->parser,
 XML_OPTION_TARGET_ENCODING, 'UTF-8' );
                 break;
         case 'ISO-8859-1':
                 xml_parser_set_option( $this->parser,
 XML_OPTION_TARGET_ENCODING, 'ISO-8859-1' );
                 break;
 }
 #MODIFICATIONS END
                 # pass in parser, and a reference to this object
                 # setup handlers
                 #
                 xml_set_object( $this->parser, $this );
                 xml_set_element_handler($this->parser,

 }}}

 This would handle only iso-8859-1 to utf-8 and vice-versa, but most
 western blogs use one of these two encodings. Handling a percentage of the
 cases is better than none at all, I think. :)

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


More information about the wp-trac mailing list