On Mon, 25 Jan 2010 02:34:50 +0000 liushaobo <[email protected]> wrote:
> > > > > Paul Cockings wrote: > > > Stevan Bajić wrote: > > >> On Sat, 23 Jan 2010 03:38:32 +0000 > > >> liushaobo <liusha...@li...> wrote: > > >> > > >> > > >>> hello stevan > > >>> > > >>> > > >> Hello, > > >> > > >> > > >> > > >>> > > >>> > > >>> Still the case, Chinese is garbled > > >>> > > >> and releases < 3.9.0 did not had the same issue? > > >> > > >> > > > Problem exists in 3.8.0 > > > > > Also, also problem seems to exist with Russian and Korean (3.8.0) - > > untested on 3.9.0 > > > > > Could you look the raw subject of the message and post it here? Is it MIME > encoded? > > > > > > > From: "=?GB2312?B?dGVzdA==?=" <[email protected]> > To: [email protected] > Subject: =?GB2312?B?1tC5+g==?= > MIME encoded. GIT Head has this to deal with the issue: ----------------------------------------- # HTMLize special characters if ($CONFIG{'HISTORY_HTMLIZE'} eq "yes") { $from=htmlize($from); $subject=htmlize($subject); } ----------------------------------------- And here the function doing the HTMLization: ----------------------------------------- sub htmlize { # # Replace some characters # to be HTML characters # my($text) = @_; use Encode; use HTML::Entities; if ($text =~ /^(.*?)=\?([^?]+)\?([qb])\?([^?]*)\?=(.*)$/is) { $text = encode_entities(decode($2, Encode::decode('MIME-Header', $text))); } else { $text = decode("utf8", $text) if ($text =~ /[\xC2-\xDF][\x80-\xBF]/); $text = encode_entities(decode_entities($text)); } if ($text =~ /[\xC2-\xDF][\x80-\xBF]/) { if ((-e "htmlize.pl") && (-r "htmlize.pl")) { require "htmlize.pl"; $text = htmlize_chars($text); } } return $text; } ----------------------------------------- That sub above could be reordered to only trigger the usage of htmlize.pl if the subject/from is not MIME encoded. So the function could/should look like this: ----------------------------------------- sub htmlize { # # Replace some characters # to be HTML characters # my($text) = @_; use Encode; use HTML::Entities; if ($text =~ /^(.*?)=\?([^?]+)\?([qb])\?([^?]*)\?=(.*)$/is) { $text = encode_entities(decode($2, Encode::decode('MIME-Header', $text))); } else { $text = decode("utf8", $text) if ($text =~ /[\xC2-\xDF][\x80-\xBF]/); $text = encode_entities(decode_entities($text)); if ($text =~ /[\xC2-\xDF][\x80-\xBF]/) { if ((-e "htmlize.pl") && (-r "htmlize.pl")) { require "htmlize.pl"; $text = htmlize_chars($text); } } } return $text; } ----------------------------------------- For me it's difficult to find a solution that suits all needs, because: - my language capabilities are limited - I don't know all possible (wrong) ways how a mailer is sending those headers - my time is limited - the Web-UI is supposed to be replaced anyway with a new PHP based Web UI - etc... So if someone is not happy with the functions the Web-UI is offering, then go ahead and code a fix and send us a patch. > Date: Sat, 23 Jan 2010 18:53:15 +0800 > Mime-version: 1.0 > X-Originating-Ip: [192.168.0.5] > X-Mailer: ExtMail 1.1.0 > Content-Type: text/html; charset="GB2312" > Content-Transfer-Encoding: 8bit > Message-Id: <[email protected]> > X-DSPAM-Result: Innocent > X-DSPAM-Processed: Sat Jan 23 18:53:16 2010 > X-DSPAM-Confidence: 1.0000 > X-DSPAM-Probability: 0.0023 > X-DSPAM-Signature: 4b5ad51c23827590621426 > One good thing about those headers above: THEY ARE PERFECT! Perfect in terms that they are properly encoded. I see so many headers send by mailers that do not encode them in the proper way. I don't know if you guys know but they mail headers are supposed to be 7bit ASCII. For most English speaking/writing users this is no issue but I am German speaking/writing and I see so many mails send by mailers (for example Outlook and others) sending me ä, ö, ü in the subject line. > > > > > > _________________________________________________________________ > MSN十周年庆典,查看MSN注册时间,赢取神秘大奖 > http://10.msn.com.cn ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Dspam-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspam-user
