Re: Function truncateWithEntities() made multibyte-aware
Paul Lesniewski <[email protected]>
| Newsgroups | gmane.mail.squirrelmail.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jan 20, 2010 at 1:15 PM, Paul Lesniewski <[email protected]> wrote: > On Tue, Jan 19, 2010 at 2:26 AM, Alexandros Vellis <[email protected]> wrote: >> On Mon, 18 Jan 2010 21:33:31 -0600 >> Jonathan Angliss <[email protected]> wrote: >> >> >>> Without digging too much into the code, is this called using the SM >>> users' encoding settings, or is it called using the message's >>> encoding? >> >> The problem appears when one uses a language that uses UTF-8 (or >> other multibyte) charset in Squirrelmail. So as regards your question, >> it has to do with SM user's language and therefore encoding setting. >> >> If any other charset is used in Squirrelmail, *no matter what the >> message's charset is*, then these characters are converted to entities, >> and truncate function is aware of them, so no problem there. >> >> However, if "raw" UTF-8 is used in Squirrelmail, then this function must >> be made multibyte-aware, or else: >> >> * the subject will be cut to about half of the actual characters >> resulting in an uneven truncation. >> * there is a risk of cutting half of a UTF-8 control characer, >> resulting in all sorts of ugly displays and (probably?) security >> issues. >> >> I'm guessing that UTF-8 could be translated to entities as well, but >> that's taking the long way round to this problem, IMHO. > > I intend to follow up on this issue, but will have to do so later. Please refer to the bug tracker for discussion of this one. This is definitely something I've been wanting to fix, but the submitted patch doesn't hit all the issues this code has. I submitted a new patch to the tracker. Testers highly appreciated so we can get this into 1.4.20 ASAP. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ----- squirrelmail-devel mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: [email protected] List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel