ID: 30333
Updated by: [EMAIL PROTECTED]
Reported By: altuhov at nm dot ru
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: WinXP SP2
PHP Version: 5.1.0-dev
New Comment:
Do you still expirience this problem?
Previous Comments:
------------------------------------------------------------------------
[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 = "проверка
проверка
проверка";
$arr = sscanf ($str, "%s %s %s");
print_r ($arr);
?>
^Z
Array
(
[0] => проверка
[1] => проверка
[2] => проверка
)
E:\>chcp 1251
Active code page: 1251
E:\>php
<?php
$str = "проверка
проверка
проверка";
$arr = sscanf ($str, "%s %s %s");
print_r ($arr);
?>
^Z
Array
(
[0] => пр
[1] => в
[2] => р
)
E:\>php
<?php
var_dump (setlocale (LC_ALL, "rus_RUS.1251"));
$str = "проверка
проверка
проверка";
$arr = sscanf ($str, "%s %s %s");
print_r ($arr);
?>
^Z
string(19) "Russian_Russia.1251"
Array
(
[0] => пр
[1] => вер
[2] => а
)
E:\>php test.php
string(19) "Russian_Russia.1251"
Array
(
[0] => пр
[1] => в
[2] => р
)
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?
------------------------------------------------------------------------
[2004-10-07 08:23:18] altuhov at nm dot ru
Yes.
Windows XP SP2 English version, but Russian locale.
------------------------------------------------------------------------
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=30333&edit=1