note 73052 added to ref.tidy
| From: | duarte at uma dot pt | Date: | Wed, 07 Feb 2007 15:31:07 +0000 |
| Subject: | note 73052 added to ref.tidy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123046@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/ref.tidy.php
Edit -- https://master.php.net/note/edit/73052
Del: integrated -- https://master.php.net/note/delete/73052/integrated
Del: useless -- https://master.php.net/note/delete/73052/useless
Del: bad code -- https://master.php.net/note/delete/73052/bad+code
Del: spam -- https://master.php.net/note/delete/73052/spam
Del: non-english -- https://master.php.net/note/delete/73052/non-english
Del: in docs -- https://master.php.net/note/delete/73052/in+docs
Del: other reasons-- https://master.php.net/note/delete/73052
Reject -- https://master.php.net/note/reject/73052
Search -- https://master.php.net/manage/user-notes.php