[imp] UTF-8 mail wrapping

Michael M Slusarz slusarz at mail.curecanti.org
Mon Feb 7 21:39:08 PST 2005


Quoting Nikola Lecic <nikola at serbianunity.net>:

> Nikola Lecic wrote:
>
>> Michael M Slusarz wrote:
>>
>>> Thanks for the patches; however, you did much more work than was 
>>> necessary to implement this.  I've gone ahead and implemented 
>>> flowed composition for IMP for all messages, and fixed a flowed 
>>> formatting bug in Horde's Text_Flowed package.  As a result, we no 
>>> longer need the 'wrap_width' preference at all so it has been 
>>> removed.
>>>
>>> These changes have been made in HEAD and will not appear until IMP 
>>> 4.1.0 (see commit message for details why).
>>
>>
>> Well, no, this is not enough. I still don't _see_ flowed message as 
>> flowed, neither in composer (with reply and forward flowed original 
>> message), nor in Inbox. Please compare results with patches I sent.
>
>
> Or, to be more precise, let's follow these steps:
>
> 1) Compose a UTF-8 message (for example with text I submitted with 
> patches): everything looks good in composer;
>
> 2) Send it to yourself
>
> 3) With version that include your newest changes, the new message we 
> receive appears as wrapped, although it's flowed in reality. With 
> version which includes my patch, I see that message correctly, as 
> flowed without wrapped lines.
>
> 4) Then, forward that new message to yourself. In composer window, we 
> have wrapped lines again, although composer intends to make flowed 
> message. In my version, I see non-wrapped (flowed) lines in composer.
>
> 5) Of course, received message is the same as 3)
>
> 6) Then, reply message from 3) to yourself. Of course, in both 
> versions composer shows wrapped lines, and that's ok because there's 
> not another way to show reply marks ('>'s) in plain text.
>
> 7) But again, received reply is wrapped, despite 'flowed' mark in its 
> header. In my version, I see quoted text on the right side of the 
> vertical line as flowed.

Tracked down the issue (which your code does not address either) - it 
was the fact that the preg_match() calls in Text_Flowed do not handle 
multibyte characters such as the cyrillic alphabet characters.  
Instead, we need to use a multibyte safe regex function (mb_ereg()) to 
do the line processing.  Now it appears that the rows are being 
formatted as expected - that is we are seeing rows wrapped at a certain 
amount of *characters* rather than a certain amount of *bytes*.

However, to see these fixes it will be necessary to a) run Horde CVS 
and b) configure PHP on your system with --enable-mbregex (see 
docs/INSTALL).  Because theses changes are not BC, they will not appear 
until the next intermediate version of Horde is released (3.1.0).

michael

-- 
_______________________________________
Michael Slusarz [slusarz at curecanti.org]


More information about the imp mailing list