#30333 [Fbk-Opn]: fscanf() and() not working correctly with other then English language
ID: 30333 User updated by: altuhov at nm dot ru Reported By: altuhov at nm dot ru -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: WinXP SP2 PHP Version: 5.1.0-dev New Comment: YES! Todays PHP-5.1-dev build Previous Comments: [2004-11-28 13:43:18] [EMAIL PROTECTED] Do you still expirience this problem? [2004-10-23 16:00:46] profic at nospam dot kursknet dot ru Hm, russian letters converts to it's codes. I think this is even better then looking at ugly characters =) [2004-10-23 15:53:35] profic at nospam dot kursknet dot ru E:\ver Microsoft Windows XP [Version 5.1.2600] E:\php -v PHP 5.0.2 (cli) (built: Sep 24 2004 01:25:41) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.2, Copyright (c) 1998-2004 Zend Technologies with DBG v2.11.30, (C) 2000,2004, by Dmitri Dmitrienko E:\chcp 866 Active code page: 866 E:\php ?php $str = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072;; $arr = sscanf ($str, %s %s %s); print_r ($arr); ? ^Z Array ( [0] = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; [1] = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; [2] = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; ) E:\chcp 1251 Active code page: 1251 E:\php ?php $str = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072;; $arr = sscanf ($str, %s %s %s); print_r ($arr); ? ^Z Array ( [0] = #1087;#1088; [1] = #1074; [2] = #1088; ) E:\php ?php var_dump (setlocale (LC_ALL, rus_RUS.1251)); $str = #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072; #1087;#1088;#1086;#1074;#1077;#1088;#1082;#1072;; $arr = sscanf ($str, %s %s %s); print_r ($arr); ? ^Z string(19) Russian_Russia.1251 Array ( [0] = #1087;#1088; [1] = #1074;#1077;#1088; [2] = #1072; ) E:\php test.php string(19) Russian_Russia.1251 Array ( [0] = #1087;#1088; [1] = #1074; [2] = #1088; ) E:\ Some comments to listing above: All text here is in cp1251 (windows-1251). There are 2 codepages for russian in windows: cp866 (aka OEM/DOS) and cp1251 (aka ANSI/Windows). As Windows' console can change current input/output codepage on fly, it seems to explain this bug, as with cp866 it works well and it is default console (in which php-cli is runing), but with cp1251 does not. But last 2 examples seems strange as locale is setted exactly. The test.php file is copy of the last inline PHP-code [2004-10-12 19:47:32] altuhov at nm dot ru Yes. Windows-1251. Reproduce code was writed and saved in the Notepad. [2004-10-12 19:40:43] [EMAIL PROTECTED] Is the russian locale used by winxp the same locale as the one used by the document? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30333 -- Edit this bug report at http://bugs.php.net/?id=30333edit=1
#30333 [Fbk-Opn]: fscanf() and() not working correctly with other then English language
ID: 30333 User updated by: altuhov at nm dot ru Reported By: altuhov at nm dot ru -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: WinXP SP2 PHP Version: 5.1.0-dev New Comment: Yes. Windows-1251. Reproduce code was writed and saved in the Notepad. Previous Comments: [2004-10-12 19:40:43] [EMAIL PROTECTED] Is the russian locale used by winxp the same locale as the one used by the document? [2004-10-07 08:23:18] altuhov at nm dot ru Yes. Windows XP SP2 English version, but Russian locale. [2004-10-07 01:11:56] [EMAIL PROTECTED] If the system using russian locale? [2004-10-06 14:35:59] altuhov at nm dot ru I have installed new version, but, bug is steel present. sample script: http://altuhov.nm.ru/tt.zip [2004-10-06 10:02:21] [EMAIL PROTECTED] Btw, your example works perfectly for me (PHP 4.3.10-dev, 5.0.3-dev, 5.1-dev, Linux, locale ru_RU.koi8r). The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30333 -- Edit this bug report at http://bugs.php.net/?id=30333edit=1
#30333 [Fbk-Opn]: fscanf() and() not working correctly with other then English language
ID: 30333 User updated by: altuhov at nm dot ru Reported By: altuhov at nm dot ru -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: WinXP SP2 PHP Version: 5.1.0-dev New Comment: Yes. Windows XP SP2 English version, but Russian locale. Previous Comments: [2004-10-07 01:11:56] [EMAIL PROTECTED] If the system using russian locale? [2004-10-06 14:35:59] altuhov at nm dot ru I have installed new version, but, bug is steel present. sample script: http://altuhov.nm.ru/tt.zip [2004-10-06 10:02:21] [EMAIL PROTECTED] Btw, your example works perfectly for me (PHP 4.3.10-dev, 5.0.3-dev, 5.1-dev, Linux, locale ru_RU.koi8r). [2004-10-06 08:54:36] [EMAIL PROTECTED] This example is useles, as we don't know which encoding you are using. Please put this script in a zip file and provide the link to it in this bugreport. [2004-10-06 05:05:56] altuhov at nm dot ru Description: Functions fscanf() and sscanf() is not working correctly with other then English language in the handle. In my example was used Russian language. Reproduce code: --- ?php $cont=Ïðîâåðêà Òåñòèðóþ ÎäèíÄâàÒðè; // get author info and generate DocBook entry $n = sscanf($cont,%s %s %s); print_r($n); ? Expected result: Array ( [0] = Ïðîâåðêà [1] = Òåñòèðóþ [2] = ÎäèíÄâàÒðè ) Actual result: -- Array ( [0] = Ïð [1] = âåð [2] = à ) -- Edit this bug report at http://bugs.php.net/?id=30333edit=1
#30333 [Fbk-Opn]: fscanf() and() not working correctly with other then English language
ID: 30333 User updated by: altuhov at nm dot ru Reported By: altuhov at nm dot ru -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: WinXP SP2 -PHP Version: 5.0.2 +PHP Version: 5.1.0-dev New Comment: I have installed new version, but, bug is steel present. sample script: http://altuhov.nm.ru/tt.zip Previous Comments: [2004-10-06 10:02:21] [EMAIL PROTECTED] Btw, your example works perfectly for me (PHP 4.3.10-dev, 5.0.3-dev, 5.1-dev, Linux, locale ru_RU.koi8r). [2004-10-06 08:54:36] [EMAIL PROTECTED] This example is useles, as we don't know which encoding you are using. Please put this script in a zip file and provide the link to it in this bugreport. [2004-10-06 05:05:56] altuhov at nm dot ru Description: Functions fscanf() and sscanf() is not working correctly with other then English language in the handle. In my example was used Russian language. Reproduce code: --- ?php $cont=Ïðîâåðêà Òåñòèðóþ ÎäèíÄâàÒðè; // get author info and generate DocBook entry $n = sscanf($cont,%s %s %s); print_r($n); ? Expected result: Array ( [0] = Ïðîâåðêà [1] = Òåñòèðóþ [2] = ÎäèíÄâàÒðè ) Actual result: -- Array ( [0] = Ïð [1] = âåð [2] = à ) -- Edit this bug report at http://bugs.php.net/?id=30333edit=1