#46843 [Asn->Csd]: Broken Euro symbol conversion into CP936

From: Date: Mon, 02 Feb 2009 04:54:42 +0000
Subject: #46843 [Asn->Csd]: Broken Euro symbol conversion into CP936
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133353@lists.php.net to get a copy of this message
 ID:               46843
 Updated by:       moriyoshi@php.net
 Reported By:      ty_c at cybozu dot co dot jp
-Status:           Assigned
+Status:           Closed
 Bug Type:         mbstring related
 Operating System: *
 PHP Version:      5.2.8
 Assigned To:      moriyoshi
 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------

[2009-01-27 10:35:25] felipe@php.net

Assigned to maintainer.

------------------------------------------------------------------------

[2008-12-12 09:07:03] 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 {






------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46843&edit=1



Thread (3 messages)

« previous php.bugs (#133353) next »