From:             thomas at haeber dot de
Operating system: SuSE Linux 8.2 (2.4.20)
PHP version:      4.3.1
PHP Bug Type:     Strings related
Bug description:  htmlentities($value, ..., "UTF-8") doesn't to UTF-8 correctly and 
completely

Description:
------------
Hi guys,

I used the htmlentities-function for converting values of different
Languages to UTF-Code - see example 1.
But PHP doesn't convert these accent-letters to UTF-8-Code.

Furthermore I've realized that PHP doesn't converts the °-Symbol to °
but to ° - see example 2.




Reproduce code:
---------------
// example 1:

$value = "LA RÉCRÉ"; // with accent-letters of french language
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
echo $value;
// Output: LA RÉCRÉ (not LA RÉCRÉ)



// example 2:

$value = "13°";
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
echo $value;
// OUTPUT: 13° (not 13°)

Expected result:
----------------
LA RÉCRÉ

13°

Actual result:
--------------
htmlentities (UTF-8) converts ° wrongly to °.
htmlentities doesn't convert french accent-letters.

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

Reply via email to