#42393 [Asn->Bgs]: mb_strtoupper is replacing one of the cyrillic symbols with wrong one.
| From: | hirokawa@php.net | Date: | Sat, 25 Aug 2007 05:29:05 +0000 |
| Subject: | #42393 [Asn->Bgs]: mb_strtoupper is replacing one of the cyrillic symbols with wrong one. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116652@lists.php.net to get a copy of this message | ||
ID: 42393
Updated by: hirokawa@php.net
Reported By: ivan dot delchev at softconsultgroup dot com
-Status: Assigned
+Status: Bogus
Bug Type: mbstring related
Operating System: Windows XP
PHP Version: 5.2.3
Assigned To: hirokawa
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You must specify specific character encoding because the conversion
table between lower/upper chars is depends on the encoding.
Please try,
mb_strtoupper($main_string,"UTF-8")
or set mbstring.internal_encoding = UTF-8 in your php.ini.
Previous Comments:
------------------------------------------------------------------------
[2007-08-23 14:40:23] ivan dot delchev at softconsultgroup dot com
[mbstring]
; language for internal character representation.
;mbstring.language = Japanese
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = EUC-JP
; http input encoding.
;mbstring.http_input = auto
; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = SJIS
; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
;mbstring.encoding_translation = Off
; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto
; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
; enable strict encoding detection.
;mbstring.strict_encoding = Off
------------------------------------------------------------------------
[2007-08-23 14:30:54] hirokawa@php.net
Please show me mbstring.language setting in php.ini.
------------------------------------------------------------------------
[2007-08-23 09:06:53] jani@php.net
Assigned to mbstring maintainer.
------------------------------------------------------------------------
[2007-08-23 08:06:01] ivan dot delchev at softconsultgroup dot com
Description:
------------
mb_strtoupper is doind wrong transformation for "å" in cyrillic
alphabetic. Whe wrong transformation "å"->"í".
Also the function is not UPPER the string!
Reproduce code:
---------------
// Ensure that the web browser encoding is UTF8 and edit application is
UTF8 compatible!
$main_string = "Òîâà å òåñò. Îòíîâî Òåñò. Êàêâî áè ñå
ïîëó÷èëî ñ òîçè
ÒÅÑÒ äà âèäèì!";
var_dump($main_string);
var_dump(mb_strtoupper($main_string));
Expected result:
----------------
Dumped result to be the same. And second string to be UPPER!
Actual result:
--------------
string(120) "Òîâà å òåñò. Îòíîâî Òåñò. Êàêâî áè ñå ïîëó÷èëî
ñ òîçè ÒÅÑÒ
äà âèäèì!"
string(120) "Òîâà ï òïñò. Îòíîâî Òïñò. Êàêâî áè ñï ïîëó÷èëî
ñ òîçè ÒÅÑÒ
äà âèäèì!"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42393&edit=1