Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35520 : Functioncs substr, str_replace, strtr and other do not work with UTF-8 string
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 12th June 06:17
php-bugs@lists.php.net (kotysek at email dot
External User
 
Posts: 1
Default #35520 : Functioncs substr, str_replace, strtr and other do not work with UTF-8 string


From: kotysek at email dot cz
Operating system: Windows XP
PHP version: 4.4.1
PHP Bug Type: *Languages/Translation
Bug description: Functioncs substr, str_replace, strtr and other do not work with UTF-8 string

Description:
------------
If I try to use almost any string function on a string with non-ascii
characters encoded in UTF-8 I get some messed up results.

This relates mainly to: substr, str_replace, strtr, strtolower,
strtoupper, strlen, ...

My string: consists of czech, slovak, german, etc. chars like (č) ,
ň (ň) (&auml , (&ouml ,...

I can't even use the most basic thing like below.

Reproduce code:
---------------
$string = "aa"; // last character is special czech "c" (č)
echo $string[2];

Expected result:
----------------
// the code should just print "" (č)


Actual result:
--------------
// it prints some character (depends on the character following ""


--
Edit bug report at http://bugs.php.net/?id=35520&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35520&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35520&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35520&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35520&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35520&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35520&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35520&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35520&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35520&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35520&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35520&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35520&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35520&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35520&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35520&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35520&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35520&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35520&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35520&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35520&r=mysqlcfg
  Reply With Quote


  sponsored links


2 12th June 06:17
tony2001
External User
 
Posts: 1
Default #35520 : Functioncs substr, str_replace, strtr and other do not work with UTF-8 string


ID: 35520
Updated by: tony2001@php.net
Reported By: kotysek at email dot cz
-Status: Open
+Status: Wont fix
-Bug Type: *Languages/Translation
+Bug Type: Strings related
Operating System: Windows XP
PHP Version: 4.4.1
New Comment:

This is the main reason for PHP6 to appear.
So you have to wait for it.


Previous Comments:
------------------------------------------------------------------------

[2005-12-02 12:18:56] kotysek at email dot cz

Description:
------------
If I try to use almost any string function on a string with non-ascii
characters encoded in UTF-8 I get some messed up results.

This relates mainly to: substr, str_replace, strtr, strtolower,
strtoupper, strlen, ...

My string: consists of czech, slovak, german, etc. chars like
(č) , ň (ň) (&auml , (&ouml ,...

I can't even use the most basic thing like below.

Reproduce code:
---------------
$string = "aa"; // last character is special czech "c" (č)
echo $string[2];

Expected result:
----------------
// the code should just print "" (č)


Actual result:
--------------
// it prints some character (depends on the character following ""



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35520&edit=1
  Reply With Quote
3 12th June 11:25
php-bugs@lists.php.net (kotysek at email dot
External User
 
Posts: 1
Default #35520 : Functioncs substr, str_replace, strtr and other do not work with UTF-8 string


From: kotysek at email dot cz
Operating system: Windows XP
PHP version: 4.4.1
PHP Bug Type: *Languages/Translation
Bug description: Functioncs substr, str_replace, strtr and other do not work with UTF-8 string

Description:
------------
If I try to use almost any string function on a string with non-ascii
characters encoded in UTF-8 I get some messed up results.

This relates mainly to: substr, str_replace, strtr, strtolower,
strtoupper, strlen, ...

My string: consists of czech, slovak, german, etc. chars like (č) ,
ň (ň) (&auml , (&ouml ,...

I can't even use the most basic thing like below.

Reproduce code:
---------------
$string = "aa"; // last character is special czech "c" (č)
echo $string[2];

Expected result:
----------------
// the code should just print "" (č)


Actual result:
--------------
// it prints some character (depends on the character following ""


--
Edit bug report at http://bugs.php.net/?id=35520&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35520&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35520&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35520&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35520&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35520&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35520&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35520&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35520&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35520&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35520&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35520&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35520&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35520&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35520&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35520&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35520&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35520&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35520&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35520&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35520&r=mysqlcfg
  Reply With Quote
4 12th June 11:25
tony2001
External User
 
Posts: 1
Default #35520 : Functioncs substr, str_replace, strtr and other do not work with UTF-8 string


ID: 35520
Updated by: tony2001@php.net
Reported By: kotysek at email dot cz
-Status: Open
+Status: Wont fix
-Bug Type: *Languages/Translation
+Bug Type: Strings related
Operating System: Windows XP
PHP Version: 4.4.1
New Comment:

This is the main reason for PHP6 to appear.
So you have to wait for it.


Previous Comments:
------------------------------------------------------------------------

[2005-12-02 12:18:56] kotysek at email dot cz

Description:
------------
If I try to use almost any string function on a string with non-ascii
characters encoded in UTF-8 I get some messed up results.

This relates mainly to: substr, str_replace, strtr, strtolower,
strtoupper, strlen, ...

My string: consists of czech, slovak, german, etc. chars like
(č) , ň (ň) (&auml , (&ouml ,...

I can't even use the most basic thing like below.

Reproduce code:
---------------
$string = "aa"; // last character is special czech "c" (č)
echo $string[2];

Expected result:
----------------
// the code should just print "" (č)


Actual result:
--------------
// it prints some character (depends on the character following ""



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35520&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666