Re: gibberish output when using the loadHTMLFile() function.
| From: | Maciek Sokolewicz | Date: | Mon, 12 Aug 2013 11:35:50 +0000 |
| Subject: | Re: gibberish output when using the loadHTMLFile() function. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321840@lists.php.net to get a copy of this message | ||
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