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): <?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";}} ?> Code (PHP): 2) And then i simply echo the sentences: <?php require_once "engine_locales_core.php"; $locale = array(); ?> <?php echo $locale['0021']; ?> Code (PHP): 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.
I too faced this hassle few days back. Here is the solution I found after googling. I have condensed it on my blog. http://www.w3hobbyist.com/php-mysql...devanagiri-hindi-marathi-from-mysql-database/ [NOte: Ignore the language names part, concentrate on the technical part]
have you tried setting a content-type meta and header? header('Content-Type:...'); also, i wouldn't trust data received from the user in the cookie. cookies can be changes. i wouldn't trust any input from the user. always validate.