Re: gibberish output when using the loadHTMLFile() function.

[email protected] (Maciek Sokolewicz)
Newsgroups php.general
Message-ID <[email protected]>
On 12-8-2013 2:54, atar wrote:
> Hi there!!
>
> When I'm trying to load an external html document with the
> loadHTMLFile() function and then I use the saveHTML() function to output
> its content, some text in the external html document which is written in
> hebrew is displayed in a gibberish format. is anyone here has an idea
> how to solve this problem?
>
> NOTE: the document itself is encoded in utf-8 character set.
>
> Thanks in advance!!
>
> atar.

First of all, stop triple-posting to each list. Choose one address, and 
stick to it.

As for your question; the character set needs to be announced as well as 
set. So to display in UTF-8, you need to:
1. make sure the document is actually encoded using the UTF-8 charset
2. make sure the browser recieves an HTTP header which tells it the 
content is in UTF-8: header('Content-type: text/html; charset=utf-8')
3. make sure the document itself states its encoding is UTF-8 (usually 
done using a <meta http-equiv="Content-Type" content="text/html; 
charset=utf8"/>

If your output conforms to all three of these, it will work. It probably 
does not conform to it however.
- Tul
- Tul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.