ID: 25883 User updated by: thomas at haeber dot de Reported By: thomas at haeber dot de -Status: Bogus +Status: Closed Bug Type: Strings related Operating System: SuSE Linux 8.2 (2.4.20) PHP Version: 4.3.1 New Comment:
Oh. THX Previous Comments: ------------------------------------------------------------------------ [2003-10-16 17:40:40] [EMAIL PROTECTED] The "utf-8" parameter specifies that your input string is already utf-8 encoded, so that it doesn't incorrectly translate bytes to entities. htmlentities() does not perform codeset conversions, and does not convert to numeric entities. ------------------------------------------------------------------------ [2003-10-16 11:09:10] thomas at haeber dot de Hi, I don't know why this shoudn't be a bug, but when you say it, it is so. Can I ask you, when i can count on php will recognize this issue so i can use htmlentities($String, ..., "UTF-8") to convert ° to ° instead of °, or when this function will convert these french letters to them UTF-8-equivalent? Otherwise i have to use an ugly workaround, which could be unneccessary in the future. THX Thomas ------------------------------------------------------------------------ [2003-10-15 19:08:52] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Whenever possible PHP will prefer html entities over &#[number]; ------------------------------------------------------------------------ [2003-10-15 10:21:11] thomas at haeber dot de 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 this bug report at http://bugs.php.net/?id=25883&edit=1