6.0.0-alpha12
6/12/25

[#9992] Encoding issues
Summary Encoding issues
Queue IMP
Queue Version 5.0.1
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester azurit (at) pobox (dot) sk
Created 04/26/2011 (5161 days ago)
Due
Updated 05/10/2011 (5147 days ago)
Assigned
Resolved 05/10/2011 (5147 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/10/2011 03:14:43 AM Michael Slusarz Comment #20
State ⇒ Not A Bug
Reply to this comment
I tried the attached script (in UTF-8) on these installations:
PHP 5.2.6 and libxml 2.6.32 = broken
PHP 5.3.5 and libxml 2.6.32 = broken
PHP 5.3.2 and libxml 2.7.6 = ok

Seems that problem is in libxml. Will you include the patch into 
Horde in case i find a sufficient solution ?
Which is why we explicitly say that libxml 2.6 is broken in 
horde/docs/INSTALL.
05/07/2011 07:20:28 AM azurit (at) pobox (dot) sk Comment #19
New Attachment: xml.php Download
Reply to this comment
I tried the attached script (in UTF-8) on these installations:
PHP 5.2.6 and libxml 2.6.32 = broken
PHP 5.3.5 and libxml 2.6.32 = broken
PHP 5.3.2 and libxml 2.7.6 = ok

Seems that problem is in libxml. Will you include the patch into Horde 
in case i find a sufficient solution ?
05/07/2011 06:47:03 AM azurit (at) pobox (dot) sk Comment #18 Reply to this comment
Which versions of libxml and PHP do you use ? I'm using libxml 2.6.32 
and PHP 5.2.6 - both are original Debian Lenny packages so, if they 
are broken, lots of other users will have problems. Do you mind to 
'fix' this if problem is really in libxml ?
05/06/2011 09:04:55 PM Michael Slusarz Comment #17 Reply to this comment

[Show Quoted Text - 14 lines]
This won't work because it introduces a dependency on the mbstring PHP 
extension.

And as mentioned I previously, I can't duplicate this.  So that may 
mean that your libxml/PHP is broken.  Which is why I need a 
reproducible test case before I am going to look at making any changes.

05/04/2011 12:51:10 PM azurit (at) pobox (dot) sk Comment #16 Reply to this comment
5.0.2 and 5.0.3 are affected too
04/29/2011 12:47:57 AM azurit (at) pobox (dot) sk Comment #15 Reply to this comment
It takes me about half of the day but i was able to find and fix the 
problem. Unicode characters were broken by PHP funcion 'loadHTML' of 
'DOMDocument' class. I have made this change in Horde source code 
based on comments on 
http://sk.php.net/manual/en/domdocument.loadhtml.php :

File: /usr/share/php/Horde/Domhtml.php

- $doc->loadHTML($this->_xmlencoding . 
Horde_String::convertCharset($text, $charset, 'UTF-8'));

+ $text = mb_convert_encoding(Horde_String::convertCharset($text, 
$charset, 'UTF-8'), 'HTML-ENTITIES', 'UTF-8');
+ $doc->loadHTML($this->_xmlencoding . $text);

04/28/2011 08:46:31 AM azurit (at) pobox (dot) sk Comment #14 Reply to this comment
You can try running the test suite for Horde_Domhtml to see if it 
fails on your system.
I don't know how exactly should i do this. I downloaded the whole git 
repository and run:
php5 framework/Util/test/Horde/Util/DomhtmlTest.php

but:

Warning: require_once(Horde/Test/Autoload.php): failed to open stream: 
No such file or directory in 
/home/nobackup/git/horde/framework/Util/test/Horde/Util/Autoload.php 
on line 13

Fatal error: require_once(): Failed opening required 
'Horde/Test/Autoload.php' 
(include_path='.:/usr/share/php:/usr/share/pear') in 
/home/nobackup/git/horde/framework/Util/test/Horde/Util/Autoload.php 
on line 13

Horde is installed via pear in /usr/share/horde but Horde libraries 
are in standard path /usr/share/php/Horde .
04/27/2011 10:43:38 PM Michael Slusarz Comment #13 Reply to this comment
Probably a very good chance this is a duplicate of Ticket #9714 or 
#9567.  However, I can't reproduce.  You will have to provide a 
reproducible failing test case or else I am going to assume that your 
PHP installation is broken.

You can try running the test suite for Horde_Domhtml to see if it 
fails on your system.
04/27/2011 10:42:36 PM Git Commit Comment #12 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9992: Test case

  1 files changed, 12 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/4e8827d804ad8ecfc8e13a065e3e9b0d8e4915cb
04/27/2011 05:28:06 PM azurit (at) pobox (dot) sk Comment #11
New Attachment: part.html Download
Reply to this comment
More info: I have enabled showing of all e-mail parts so i was able to 
see HTML and also text part of the message. The HTML part is always 
broken, text part is ok. I'm attaching the source of HTML part.
04/27/2011 08:25:41 AM azurit (at) pobox (dot) sk Comment #10 Reply to this comment

[Show Quoted Text - 11 lines]
So what do you suggest ? I'm using original packages of PHP from 
Debian Lenny. Thanks.
04/27/2011 04:50:19 AM Michael Slusarz Comment #9 Reply to this comment
Which seems to indicate there is an issue with your local PHP installation.
Text is (here) displayed correctly only in text area when replaying 
to the message.

When i send non-multipart message, everything is displayed ok. 
Everything was also ok with IMP4. How can i debug this ?
There is no easy location to debug since the display code is 
(necessarily) very complicated and is controlled by a bunch of 
libraries.
04/26/2011 11:26:43 PM azurit (at) pobox (dot) sk Comment #8 Reply to this comment
Which seems to indicate there is an issue with your local PHP installation.
Text is (here) displayed correctly only in text area when replaying to 
the message.

When i send non-multipart message, everything is displayed ok. 
Everything was also ok with IMP4. How can i debug this ?
04/26/2011 11:18:44 PM Michael Slusarz Comment #7 Reply to this comment
Which seems to indicate there is an issue with your local PHP installation.
04/26/2011 11:18:07 PM Michael Slusarz Comment #6
New Attachment: output.PNG Download
Reply to this comment
Works fine here.
04/26/2011 11:09:38 PM azurit (at) pobox (dot) sk Comment #5
New Attachment: message.txt Download
Reply to this comment
Attaching message source displayed on screenshot
04/26/2011 11:08:38 PM azurit (at) pobox (dot) sk Comment #4
New Attachment: imp.jpeg Download
Reply to this comment
Attaching screenshot
04/26/2011 11:00:33 PM azurit (at) pobox (dot) sk Comment #3 Reply to this comment
Huh?  What does Gmail have to do with IMP?  And what about the 
encoding is wrong?  E.g. is something being quoted-printable encoded 
when it is supposed to be base64 encoded?
Just try to send unicode message from gmail.com to your account and 
read it via Horde/IMP - the unicode characters will be broken, IMP is 
just not able to set character set right.
04/26/2011 10:36:11 PM Michael Slusarz Comment #2 Reply to this comment
Huh?  What does Gmail have to do with IMP?  And what about the 
encoding is wrong?  E.g. is something being quoted-printable encoded 
when it is supposed to be base64 encoded?
04/26/2011 10:30:06 PM azurit (at) pobox (dot) sk Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Encoding issues
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
Unicode characters in multipart messages are broken - try to send 
multipart (plain + html) message from gmail.com which will be in 
different encoding from your default encoding.

Saved Queries