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

From: Date: Tue, 27 Jan 2009 10:35:26 +0000
Subject: #46843 [Opn->Asn]: Broken Euro symbol conversion into CP936
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133237@lists.php.net to get a copy of this message
 ID:               46843
 Updated by:       felipe@php.net
 Reported By:      ty_c at cybozu dot co dot jp
-Status:           Open
+Status:           Assigned
 Bug Type:         mbstring related
 Operating System: *
 PHP Version:      5.2.8
-Assigned To:      
+Assigned To:      moriyoshi
 New Comment:

Assigned to maintainer.


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

[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 (#133237) next »