[Tickets #9567] Re: charset pb replying to message

bugs at horde.org bugs at horde.org
Fri Mar 4 17:59:13 UTC 2011


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

Ticket URL: http://bugs.horde.org/ticket/9567
------------------------------------------------------------------------------
  Ticket             | 9567
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | charset pb replying to message
  Queue              | IMP
  Version            | Git master
  Type               | Bug
-State              | Duplicate
+State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
-Owners             |
+Owners             | Michael Slusarz
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2011-03-04 17:59) wrote:

> I got further.
>
> problem is coming from Domhtml.php. DOMDocument thinks that $text is  
> iso-8859-1, but it is UTF-8 as it has been converted earlier on.
>
> The text message gets screwed after the following call (line 83) :
>                 $doc->loadHTML(Horde_String::convertCharset($text,  
> $charset, $doc->encoding));
>
> $charset = utf-8
> $doc->encoding = iso-8859-1

So what you are saying is that BEFORE line 83, $charset is utf-8 and  
$doc->encoding is iso-8859-1?  If that is the case, I don't see why  
this isn't working... we are converting $text to ISO-8859-1 (from  
UTF-8) and then sending to loadHTML.  So things should be fine.

Maybe check what the value of $doc->encoding is AFTER line 83?  Or try  
creating a new DOMDocument object - e.g.:

                 /* If libxml can't auto-detect encoding, convert to what it
                  * *thinks* the encoding should be. */
                 $doc = new DOMDocument();
                 $doc->loadHTML(Horde_String::convertCharset($text,  
$charset, $doc->encoding));






More information about the bugs mailing list