From:             sven dot burmeister at gmx dot net
Operating system: linux
PHP version:      5.0.1
PHP Bug Type:     Unknown/Other Function
Bug description:  explode() corrupts utf8 data

Description:
------------
utf8 encoded page, send <input type=text name=foo, if you input
ferienhäuser and use array = explode(" ",$_REQUEST["foo"]) on that
variable you get an array with echo $array[0] displayed in the browser
source as ferienhã€user instead of ferienhÀuser.

echo $_REQUEST["foo"]; displays correctly

Same happens if string submitted is "ferienhäuser region" so it is not due
to the lack of a space in the string.

using php5 compiled with latest apache and mysql-support on suse linux
9.0.

Reproduce code:
---------------
<input type=text name=foo value=''>
if($_REQUEST["foo"] != ""){$array = explode(" ",$foo)}

Expected result:
----------------
in_array("ferienhäuser",$array) == true;

Actual result:
--------------
As described above in_array does not find the keyword and all browsers do
not display $array[0] correctly, although they do for $_REQUEST["foo"]

Reason, string gets corrupted.

-- 
Edit bug report at http://bugs.php.net/?id=29908&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=29908&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29908&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29908&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=29908&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=29908&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=29908&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=29908&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=29908&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=29908&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=29908&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=29908&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=29908&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=29908&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=29908&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=29908&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=29908&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=29908&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=29908&r=float

Reply via email to