note 115831 added to function.htmlspecialchars
| From: | sascham78@php.net | Date: | Wed, 01 Oct 2014 08:58:00 +0000 |
| Subject: | note 115831 added to function.htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200555@lists.php.net to get a copy of this message | ||
If you are using UTF-8 encoding with htmlspecialchars() you may experience blank values with certain
language-specific characters i.e. spanish or portuguese "âãá".
So instead of using
<?php
$utf8encoded= htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
?>
try
<?php
$utf8encoded= utf8_encode(htmlspecialchars($string, ENT_QUOTES));
?>
----
Server IP: 213.172.110.14
Probable Submitter: 212.16.235.178
----
Manual Page -- http://php.net/manual/en/function.htmlspecialchars.php
Edit -- https://master.php.net/note/edit/115831
Del: integrated -- https://master.php.net/note/delete/115831/integrated
Del: useless -- https://master.php.net/note/delete/115831/useless
Del: bad code -- https://master.php.net/note/delete/115831/bad+code
Del: spam -- https://master.php.net/note/delete/115831/spam
Del: non-english -- https://master.php.net/note/delete/115831/non-english
Del: in docs -- https://master.php.net/note/delete/115831/in+docs
Del: other reasons-- https://master.php.net/note/delete/115831
Reject -- https://master.php.net/note/reject/115831
Search -- https://master.php.net/manage/user-notes.php