From: Martin Ng <ma...@av...> - 2013-12-20 06:43:34
|
Hi, I think it is due to the wrong value in my config.php: > $default_charset = 'iso-8859-1'; After switching to utf-8, it is OK. Regards, Martin On 12/17/2013 12:53 PM, Martin Ng wrote: > Hi, > > I found that the non-unicode messages cannot be displayed correctly in > the latest SquirrelMail. > The non-unicode subject line, attachment name, etc can't be displayed. > It looks like this in one of our SquirrelMail installations: > > So the user is unable to read the message or download the attachment > because of anchor text is missing. > > I've identified the code that causes the missing text. > In functions/i18n.php (line 187): >> if (! $save_html) $string = htmlspecialchars ($string); > The htmlspecialchars returns empty string since the $string variable > contains non-UTF8 characters (say GB2312). > This is explained in the PHP documentation at > http://php.net/htmlspecialchars: >> If the input string passed to this function and the final document >> share the same character set, this function is sufficient to prepare >> input for inclusion in most contexts of an HTML document. If, >> however, the input can represent characters that are not coded in the >> final document character set and you wish to retain those characters >> (as numeric or named entities), both this function and htmlentities() >> <http://www.php.net/manual/en/function.htmlentities.php> (which only >> encodes substrings that have named entity equivalents) may be >> insufficient. You may have to use mb_encode_numericentity() >> <http://www.php.net/manual/en/function.mb-encode-numericentity.php> >> instead. > Currently, I've commented it out as a workaround. > But I think this code should be fixed officially. I don't know why > htmlspecialchars is needed there, but I think it was added on purpose. > >> * SquirrelMail version: 1.4.22 >> * Every plugin installed: built-in plugins >> * PHP version: 5.4.23 >> * Web server: 2.2.16 >> * IMAP server: Qmail installed via http://qmailrocks.thibs.com >> * SMTP server: Qmail installed via http://qmailrocks.thibs.com >> * OS: Debian Squeeze >> * How your software was installed, including the package name if >> applicable: squirrelmail-webmail-1.4.22.zip and >> squirrelmail-decode-1.2.zip >> * Browsers tried: Firefox 25.0.1 >> > > Regards, > Martin > > -- > > *Martin Ng, /MSc/ | Engineering Manager* > "we love what we do" > www.avalade.com <http://www.avalade.com> | Google+ > <https://plus.google.com/108432764531553527223> | facebook > <http://www.facebook.com/avaladegroup> *avalade group > limited | marketing management technology* > 26C, MG Tower, 133 Hoi Bun Road, Kowloon, Hong Kong > Tel: +852 8212 0181 | Fax: +852 8212 0183 > > > Disclaimer: This transmission and the information it contains, > including any attachment, is intended solely for the named > recipient(s). It is confidential and the unauthorized use, disclosure > or copying of this transmission or such information is prohibited. If > you are not the/a recipient, and are in possession of this > transmission (or any copy) without the consent of any named recipient, > please notify the originator immediately and delete the transmission > (including any attachment) and its contents. > -- *Martin Ng, /MSc/ | Engineering Manager* "we love what we do" www.avalade.com <http://www.avalade.com> | Google+ <https://plus.google.com/108432764531553527223> | facebook <http://www.facebook.com/avaladegroup> *avalade group limited | marketing management technology* 26C, MG Tower, 133 Hoi Bun Road, Kowloon, Hong Kong Tel: +852 8212 0181 | Fax: +852 8212 0183 Disclaimer: This transmission and the information it contains, including any attachment, is intended solely for the named recipient(s). It is confidential and the unauthorized use, disclosure or copying of this transmission or such information is prohibited. If you are not the/a recipient, and are in possession of this transmission (or any copy) without the consent of any named recipient, please notify the originator immediately and delete the transmission (including any attachment) and its contents. |