libtidy-php: does not clean invalid character refs

hi,

I am using the following code to automatically create correct xhtml:

// send through tidy
tidy_set_encoding('utf8');
tidy_parse_string($text);
tidy_setopt('output-xhtml', true);
tidy_setopt('add-xml-decl', true);
tidy_setopt('show-errors', true);
tidy_setopt('show-warnings', true);
tidy_setopt('indent', true);
tidy_setopt('clean-output', true);
tidy_setopt('clean', true);
tidy_setopt('input-encoding', 'utf8');
tidy_setopt('output-encoding', 'utf8');
tidy_clean_repair();
echo tidy_get_output();

And the output still contains invalid character references because
this still shows when I run the command-line tidy over the result:

line 1567 column 31 - Warning: replacing invalid character code 145
line 1573 column 31 - Warning: replacing invalid character code 145
line 1579 column 33 - Warning: replacing invalid character code 145
line 1712 column 45 - Warning: <a> attribute with missing trailing quote
mark
line 1771 column 28 - Warning: replacing invalid character code 136

How can I get libtidy under PHP to fix these "invalid character
messages"?

I am using libtidy 20050415-1 on debian sarge with php-tidy 1.2 (which
seems to be no longer maintained).

thanks!
-- 
Felix Natter <felix.natter@smail.inf.fh-brs.de>

Received on Tuesday, 23 January 2007 18:43:39 UTC