note 73080 added to function.tidy-setopt
| From: | duarte at uma dot pt | Date: | Thu, 08 Feb 2007 12:49:50 +0000 |
| Subject: | note 73080 added to function.tidy-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123117@lists.php.net to get a copy of this message | ||
I had some problems parsing PHP 4.4.4 pages with Tidy, because of ISO-8859-1 caracters in URL's
parameters.
If I had an URL like this:
<a href="http://www.example.com?search=joão">
When I used Tidy do parse a page with this URL, it was transformed in:
<a href="http://www.example.com?search=joão">
The solution was to disable the Tidy option fix-uri which is enabled by default. This option was
converting ISO-8859-1 URL's caracters to UTF-8.
So the final PHP code to parse the page with Tidy is:
/* disable option */
tidy_setopt('fix-uri',0);
tidy_setopt('indent', 1);
tidy_setopt('wrap', 1024);
tidy_setopt('output-xhtml', 1);
/* parse page */
tidy_parse_string($vs_page_html);
echo tidy_get_output();
----
Server IP: 81.92.200.26
Probable Submitter: 193.136.232.3
----
Manual Page -- http://www.php.net/manual/en/function.tidy-setopt.php
Edit -- https://master.php.net/note/edit/73080
Del: integrated -- https://master.php.net/note/delete/73080/integrated
Del: useless -- https://master.php.net/note/delete/73080/useless
Del: bad code -- https://master.php.net/note/delete/73080/bad+code
Del: spam -- https://master.php.net/note/delete/73080/spam
Del: non-english -- https://master.php.net/note/delete/73080/non-english
Del: in docs -- https://master.php.net/note/delete/73080/in+docs
Del: other reasons-- https://master.php.net/note/delete/73080
Reject -- https://master.php.net/note/reject/73080
Search -- https://master.php.net/manage/user-notes.php