Issues with tidy and utf-8 encoding
| From: | Youri LACAN-BARTLEY | Date: | Thu, 30 Nov 2006 16:21:36 +0000 |
| Subject: | Issues with tidy and utf-8 encoding | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245354@lists.php.net to get a copy of this message | ||
Hi list,
this is my first post and I've only been lurking around these premises
for the past week.
I've been running into some strange issues with tidy.
When I try and output my HTML in utf-8 all the accentuated characters
come out as total gobbledeegook.
I've have no issues echoing a string via utf8_encode(), the browser
picks up the right encoding and everything comes out fine.
The only workaround I've found so far is this :
$tidy = new tidy;
$tidy->parseString(utf8_encode($html), $config, 'utf8');
$tidy->cleanRepair();
echo $tidy;
Which is really dodgy if you ask me.
Has anyone run into the same kind of problem before?
I've set a meta tag as follows, but that seems to be modified by tidy on
the fly if ever the used encoding differs from the one indicated in the
meta tag.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Any help would be greatly appreciated.
Cheers,
Youri