Log in with username/password: lyceum/lyceum

Ticket #876 (new enhancement)

Opened 11 months ago

Last modified 10 months ago

The non-English character of email title is in disorder

Reported by: lyceum Assigned to:
Priority: normal Milestone: 1.1
Keywords: encoding email Cc: asheesh@creativecommons.org, xfliu.math@gmail.com

Description (Last modified by jjb)

When I use some Chinese translation interface, the email title will be in Chinese but it can not be display correctly. I am not sure it is a bug or not, maybe depending on the server settings. However, I have modified the source code to make it work well now.

In my case, I choosed "UTF-8" encoding.

  • src/lyceum/wp-includes/pluggable-functions.php

    old new  
    164164 
    165165if ( !function_exists('wp_mail') ) : 
    166166function wp_mail($to, $subject, $message, $headers = '') { 
     167 
     168      mb_language("uni");//PEAK 
     169      mb_internal_encoding("UTF-8");//PEAK 
     170 
    167171       if( $headers == '' ) { 
    168172               $headers = "MIME-Version: 1.0\n" . 
    169173                       "From: \"".get_settings('site_title').'"<'.get_settings('system_admin_email').'>' . "\n" .  
    170174                       "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; 
    171175       } 
    172176 
    173        return @mail($to, $subject, $message, $headers); 
     177       return @mb_send_mail($to, $subject, $message, $headers);//PEAK 
    174178} 
    175179endif; 
    176180 

Here is the reference page. It seems it has only relation with Japanese one and UTF-8 . http://jp2.php.net/mb_language

Change History

10/30/07 03:04:32 changed by jjb

  • description changed.

10/30/07 23:26:02 changed by jjb

  • milestone changed from 1.0.1 to 1.1.

Thank you for this patch. We need to give is some consideration and testing, to make sure it doesn't break on some installations.

Meanwhile, I am keeping the ticket, and made a note of it here:

http://wiki.lyceum.ibiblio.org/index.php/Main_Page#Advanced_Topics

11/02/07 02:01:43 changed by lyceum

  • cc changed from xfliu.math@gmail.com to asheesh@creativecommons.org, xfliu.math@gmail.com.

This will require the mb extension, but Lord, I hope everyone has that these days.

I fear it might try to "double-encode" things, like if you pass it SHIFT-JIS data it could result in corrupted nonsense instead of UTF-8 as the output. I don't actually have experience with PHP mb; you would probably do well to make this an upstream ticket and see what WP thinks/does, and/or talk to people with real experience with PHP MB.

I think this cannot make things worse than they are right now.

Log in with username/password: lyceum/lyceum