php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46843 Broken Euro symbol conversion into CP936
Submitted: 2008-12-12 09:07 UTC Modified: 2009-02-02 04:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ty_c at cybozu dot co dot jp Assigned: moriyoshi
Status: Closed Package: mbstring related
PHP Version: 5.2.8 OS: *
Private report: No CVE-ID:
 [2008-12-12 09:07 UTC] ty_c at cybozu dot co dot jp
Description:
------------
(Actual)
mb_convert_encoding() mistranslates the Euro symbol (€, Unicode 
codepoint U+20AC) into character encoding CP936 as:

0x00 0x80


(Expected)
The correct translation is:

0x80


(Affects)
This defect is present in CVS HEAD, & version 4.4.7.


(Patch)

Index: php/ext/mbstring/libmbfl/filters/mbfilter_cp936.c
===================================================================
--- php/ext/mbstring/libmbfl/filters/mbfilter_cp936.c (revision 15404)
+++ php/ext/mbstring/libmbfl/filters/mbfilter_cp936.c (revision 22611)
@@ -193,5 +193,5 @@
 	}
 	if (s >= 0) {
-		if (s < 0x80) {	/* latin */
+		if (s <= 0x80) {	/* latin + euro sign */
 			CK((*filter->output_function)(s, filter-
>data));
 		} else {





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-27 10:35 UTC] felipe@php.net
Assigned to maintainer.
 [2009-02-02 04:54 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 16:02:22 2014 UTC