ID: 46214
User updated by: dimedrol at tut dot by
Reported By: dimedrol at tut dot by
Status: Bogus
Bug Type: Strings related
Operating System: GNU/Linux i686 2.6.9
PHP Version: 5.2.6
New Comment:
I would underline, that mbstring is intended for multibyte characters
whereas I use single-byte encoding CP-1251 so why would I need mbstring
then?
Previous Comments:
------------------------------------------------------------------------
[2008-10-07 12:25:25] [EMAIL PROTECTED]
Yes, use mbstring. No bug here.
------------------------------------------------------------------------
[2008-10-01 18:13:55] dimedrol at tut dot by
In my sample code cyrillic characters were replaced by unicode escape
sequences. Please note that originally they were single-byte cp-1251
characters.
------------------------------------------------------------------------
[2008-10-01 18:11:55] dimedrol at tut dot by
Description:
------------
When I run short script below I every time receive different values in
output. It may print 7 and may print 11. PHP-file has encoding cp-1251.
Here's version info from my webserver
-bash-2.05b$ /usr/sbin/httpd -V
Server version: Apache/2.0.63
Server built: Jul 22 2008 23:09:16
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Reproduce code:
---------------
<?php
print(strpos('вася12hello[b]','[b]'));
?>
it contains cyrillic characters. If I replace them with latin ones
everything works fine
Expected result:
----------------
I expect 11 to be printed
Actual result:
--------------
Actual results is sometimes 11 and sometimes 7. 7 looks like cyrillic
characters are simply omitted during calculation.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46214&edit=1