[wp-trac] [WordPress Trac] #6873: Character set problem in media uploader

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 29 14:47:38 GMT 2008


#6873: Character set problem in media uploader
----------------------------+-----------------------------------------------
 Reporter:  duncanmc        |       Owner:  anonymous             
     Type:  defect          |      Status:  new                   
 Priority:  normal          |   Milestone:  2.5.2                 
Component:  Administration  |     Version:  2.5.1                 
 Severity:  normal          |    Keywords:  charset, character set
----------------------------+-----------------------------------------------
 I am using a windows-1254 based translation file and my blog character
 encoding is windows-1254. After uploading an image by using the media
 uploader, when I click on "Show", character encoding of image property
 text like "caption", "link url" etc. are wrong. They show ? characters on
 special characters. I saw that it is because AJAX does not send the
 encoding type information when updating the page, so encoding becomes
 wrong. To solve this problem it is necessary to change the line


 {{{
 header('Content-Type: text/plain');
 }}}

  to

 {{{
 header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
 }}}

  in the file wp-admin/async-upload.php file. More exact place of the line
 is

 {{{
 // Flash often fails to send cookies with the POST or upload, so we need
 to pass it in GET or POST instead
 if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
         $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
 unset($current_user);
 require_once('admin.php');

 header('Content-Type: text/plain');
 }}}


 must be


 {{{
 // Flash often fails to send cookies with the POST or upload, so we need
 to pass it in GET or POST instead
 if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
         $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
 unset($current_user);
 require_once('admin.php');

 header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
 }}}

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


More information about the wp-trac mailing list