Utf8 hassle

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
satikas
Forum Newbie
Posts: 19
Joined: Sat Mar 28, 2009 9:14 am

Utf8 hassle

Post by satikas »

Ive developed a locales system for my site, but its not working the way it should.
Let me explain:
1) This file decides which lang file to use (engine_locales_core.php):

Code: Select all

<?php session_start();
$locale = array();
$ename = $_COOKIE['user1'];
if(!isset($_COOKIE['user1'])){
    require_once "engine_locales_English.php";}
elseif(isset($_COOKIE['user1'])){
  require_once "globalconfig.php";
  $getlang = mysql_query("SELECT language FROM users WHERE ename = '$ename'")or die(mysql_error());
   while($info = mysql_fetch_array( $getlang )){
    require_once "engine_locales_".$info['language'].".php";}}
  ?>
2) And then i simply echo the sentences:
<?php require_once "engine_locales_core.php"; $locale = array(); ?>

Code: Select all

<?php echo $locale['0021']; ?>
Looks just fine when i load the page: äöüõ.
But when i refresh it, these characters turn into: ????

Whats up with that?
Thanks for any help.
Last edited by Benjamin on Mon May 18, 2009 9:47 am, edited 1 time in total.
Reason: Changed code type from text to php.
Post Reply