I want that Japanese characters are shown in my web page. for this i am using the way of array. using this:-
http://www.onlamp.com/pub/a/php/2002/11/28/php_i18n.html?page=1
I make this small program using UNICODE character format
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
</head>
<body>
</body>
</html>
<?php
$messages = array (
'en_US'=> array(
'My favorite foods are' =>
'My favorite foods are',
'french fries' => 'french fries',
'biscuit' => 'biscuit',
'candy' => 'candy',
'potato chips' => 'potato chips',
'cookie' => 'cookie',
'corn' => 'corn',
'eggplant' => 'eggplant'
),
'en_GB'=> array(
'My favorite foods are' =>
'My favourite foods are',
'french fries' => 'ああああああ',
'biscuit' => 'terif',
'candy' => '丈上七且上万',
'potato chips' => 'crisps',
'cookie' => 'ああああああ',
'corn' => 'maize',
'eggplant' => 'ああああああ'
)
);
function msg($s) {
global $LANG;
global $messages;
if (isset($messages[$LANG][$s])) {
return $messages[$LANG][$s];
} else {
error_log("l10n error:LANG:" .
"$lang,message:'$s'");
}
}
?>
<?php
$LANG ='en_GB';
print msg('My favorite foods are').":<br>";
print msg('french fries')."<br>";
print msg('potato chips')."<br>";
print msg('corn')."<br>";
print msg('candy')."<br>";
print msg('potato chips')."<br>";
?>
when this program runs it shows the output like this
array( 'My favorite foods are' => 'My favorite foods are', 'french fries' => 'french fries', 'biscuit' => 'biscuit', 'candy' => 'candy', 'potato chips' => 'potato chips', 'cookie' => 'cookie', 'corn' => 'corn', 'eggplant' => 'eggplant' ), 'en_GB'=> array( 'My favorite foods are' => 'My favourite foods are', 'french fries' => 'かかか ', 'biscuit' => '???', 'candy' => '???', 'potato chips' => 'かかか', 'cookie' => '??', 'corn' => 'ああああああ', 'eggplant' => 'かかか' ) ); function msg($s) { global $LANG; global $messages; if (isset($messages[$LANG][$s])) { return $messages[$LANG][$s]; } else { error_log("l10n error:LANG:" . "$lang,message:'$s'"); } } ?> "; print msg('french fries')."
"; print msg('potato chips')."
"; print msg('corn')."
"; print msg('candy')."\n"; ?>
the actual output would be:
My favourite foods are:
ああああああ
crisps
maize
鞘坂.・鞘6・
how i face this problem.please help me.