From: ty_c at cybozu dot co dot jp
Operating system: any
PHP version: 5.2.8
PHP Bug Type: mbstring related
Bug description: Broken Euro symbol conversion into CP936
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 bug report at http://bugs.php.net/?id=46843&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46843&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46843&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46843&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46843&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46843&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46843&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46843&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46843&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46843&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46843&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46843&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46843&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46843&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46843&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46843&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46843&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46843&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46843&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46843&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46843&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46843&r=mysqlcfg