|
Answer» Hey there!
I'm having problems getting unicode characters to work. "ä, Ä, ö, Ö, ü, Ü, õ, Õ" to be more specific. The html elements in the php file are displayed correctly but when it's READING data from MYSQL database, it GIVES me weird characters.
Instead of "ü õ ö ä" I get "ü õ ö ä" It doesn't show the unicode characters in my php table if I enter data VIA php form or via mysql but characters are shown correctly in the mySQL table, doesn't matter what I use to enter the data.
http://img836.imageshack.us/img836/7277/watway.png Notice how it displays the unicode characters correctly in the bold text but not in the data field?
Here's the code of one php file.
Code: [Select]<?php mb_http_output('UTF-8'); mb_http_input('UTF-8'); mb_language('uni'); mb_regex_encoding('UTF-8'); ob_start('mb_output_handler'); header('Content-type: text/html; charset=utf-8'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <TITLE>Andmete kuvamine</title> </head> <body> <?php include 'config.php'; $sql="select osakond, soetusaasta, it_number, tooteruhm, mudeli_nimetus, sn, riigivara_nr, inventaari_nr, maja, ruum, vastutaja, markus, id, kasutajanimi from norse5_proov"; $rs=mysql_query($sql) or die($sql.">>".mysql_error()); $num=mysql_num_rows($rs); if($num>0){ ?> <table border='1'> <tr> <th>Osakond</th> <th>Soetusaasta</th> <th>IT Number</th> <th>Tooterühm</th> <th>Mudeli nimetus</th> <th>SN</th> <th>Riigivara nr</th> <th>Inventaari nr</th> <th>Maja</th> <th>Ruum</th> <th>Vastutaja</th> <th>Märkus</th> <th>ID</th> <th>Kasutajanimi</th> </tr> <?php while($row=mysql_fetch_array($rs)){ extract($row); ?> <tr> <td><?php echo $osakond; ?></td> <td><?php echo $soetusaasta; ?></td> <td><?php echo $it_number; ?></td> <td><?php echo $tooteruhm; ?></td> <td><?php echo $mudeli_nimetus; ?></td> <td><?php echo $sn; ?></td> <td><?php echo $riigivara_nr; ?></td> <td><?php echo $inventaari_nr; ?></td> <td><?php echo $maja; ?></td> <td><?php echo $ruum; ?></td> <td><?php echo $vastutaja; ?></td> <td><?php echo $markus; ?></td> <td><?php echo $id; ?></td> <td><?php echo $kasutajanimi; ?></td> </tr> <?php } ?> </table> <br> <a href="update.php">Uuenda andmeid</a><br> <a href="delete.php">Kustuta andmeid</a><br> <a href="insert.php">Sisesta andmeid</a><br> <br> <a href="index.php">Algusesse...</a> <?php }else{ echo "Andmeid ei leitud"; } ?> </body> </html>A friendly bump!
|