[Tickets #9992] Re: Encoding issues

bugs at horde.org bugs at horde.org
Fri May 6 21:04:56 UTC 2011


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9992
------------------------------------------------------------------------------
  Ticket             | 9992
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | Encoding issues
  Queue              | IMP
  Version            | 5.0.1
  Type               | Bug
  State              | Unconfirmed
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2011-05-06 21:04) wrote:

> 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);

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.







More information about the bugs mailing list