From: pl at mygrworld dot com Operating system: Linux PHP version: 5.3.14 Package: mbstring related Bug Type: Bug Bug description:Impossible to display Unicode names
Description: ------------ --- >From manual page: http://www.php.net/function.print --- A BOM mark is present at the top of the PHP script, the locale is set to UTF-8, as is the HTML Content Type. In Apache, the charset is also set to utf8. When Unicode characters are requested from MySQL, neither the echo or print functions display the characters correctly within the HTML code. However, if the characters are written directly in the HTML, they are displayed correctly. Data is requested from the MySQL database using mysql_query and mysql_fetch_assoc (or_array) into a variable (e.g. $var). A variable dump is made of the data retrieved from the database, which shows the required data in the format wanted. However, using "<?php echo $var[0]; ?>", "<?php print $var[0]; ?>" or "<? =$var[0];?>" does not get the required result in the middle of the HTML code. Test script: --------------- <?php setlocale(LC_ALL,"se_NO.utf8"); $query = "SELECT town, state FROM data_table WHERE town_id = 1"; $result=mysql_query($query, $sql_id); $town=mysql_fetch_assoc($result)); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <?=$town['town'];?><br> <? echo $town['state'];?> </body> </html> Expected result: ---------------- Borås Västra Götaland Actual result: -------------- Bor�s V�stra G�taland -- Edit bug report at https://bugs.php.net/bug.php?id=62516&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62516&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62516&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62516&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62516&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62516&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62516&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62516&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62516&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62516&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62516&r=support Expected behavior: https://bugs.php.net/fix.php?id=62516&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62516&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62516&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62516&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62516&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62516&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62516&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62516&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62516&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62516&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62516&r=mysqlcfg
