#23449 [Asn->Csd]: htmlentities encodes U+2225 and friends incorrectly
| From: | moriyoshi@php.net | Date: | Fri, 02 May 2003 11:03:01 +0000 |
| Subject: | #23449 [Asn->Csd]: htmlentities encodes U+2225 and friends incorrectly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38942@lists.php.net to get a copy of this message | ||
ID: 23449
Updated by: moriyoshi@php.net
Reported By: brofield at jellycan dot com
-Status: Assigned
+Status: Closed
Bug Type: Strings related
Operating System: windows 2000
PHP Version: 4.3.1
Assigned To: moriyoshi
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
The fix will be in 4.3.2 as well.
Previous Comments:
------------------------------------------------------------------------
[2003-05-02 05:58:33] moriyoshi@php.net
Verified.
------------------------------------------------------------------------
[2003-05-02 05:30:39] brofield at jellycan dot com
For some reason the summary got changed. Changed it back.
------------------------------------------------------------------------
[2003-05-02 05:28:53] brofield at jellycan dot com
Calling syntax is...
$str = htmlentities( "string containing U+2225", ENT_QUOTES, "utf-8"
);
Other incorrect conversions seem to abound...
$str = ctwEncodeUtf8(
"∥∦∧∨∩∪∫" );
echo $str.'<br>';
$str = htmlentities( $str, ENT_QUOTES, "utf-8" );
echo $str.'<br>';
echo htmlentities( $str, ENT_QUOTES, 'utf-8' ).'<br>';
exit;
Note: ctwEncodeUtf8 is the same function as found at
http://www.zend.com/codex.php?id=838&single=1
Results:
a∦ÈÉ¿¾ç
¿¾çÉ¿¾ç
∩∪∫É¿¾ç
The first and second lines should be the same.
------------------------------------------------------------------------
[2003-05-02 05:21:18] brofield at jellycan dot com
There seems to be a bug in htmlentities() utf-8 conversion. The unicode
character U+2225 a gets converted into ∩ which is the html entity
for the unicode character U+2229 ¿. It should be using ∥ to get
the correct symbol.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23449&edit=1