Re: [PHP-I18N] Re: Re: Re: gibberish output when using the loadHTMLFile() function

[email protected] (Ferenc Kovacs) Mon, 11 Nov 2013 08:41:02 +0100
Newsgroups php.i18n
Message-ID <CAH-PCH5S8zy57ND4mCAbRtrWCq7k5W8EZ399t=CUrBoFR=AkXA@mail.gmail.com>
--089e0153867c97e40504eae1dabb
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

2013.08.12. 11:11, "atar" <[email protected]> ezt =C3=ADrta:
>
> Hi there!!
>
> I think I've changed all the appropriate encoding parameters:
>
>> mb_internal_encoding("UTF-8");
>> iconv_set_encoding("internal_encoding", "UTF-8");
>> iconv_set_encoding("input_encoding", "UTF-8");
>> iconv_set_encoding("output_encoding", "UTF-8");/*
>> print_r(iconv_get_encoding());
>
>
> Unfortunately, non of them solved that issue.
>
> I've noticed that when I load the HTML page directly into the browser,
it's displayed appropriately when the browser encodes the document with the
UTF-8 charset, but when I instruct the browser to encode the HTML page with
the ISO-8859-1 charset, it's displayed exactly as it is displayed when I
load the HTML document through the "loadHTMLFile()" PHP's function!! this
causes me to think that the "loadHTMLFile()" PHP's function loads its file
argument with the ISO-8859-1 charset. now I apparently need to find a way
to instruct the "loadHTMLFile()" PHP's function to load its file argument
using the UTF-8 charset. I still didn't find this way. if someone has any
idea, I'll be very happy to know!
>
> Thanks in advance!!
>
> atar.
>
>
> --
> PHP Unicode & I18N Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

The domdocument extensions loadhtmlfile method gets the encoding from the
appropriate meta tag in the html.
If it's missing or wrong then you can experience problems like you
mentioned.

--089e0153867c97e40504eae1dabb--