Hello,

[EMAIL PROTECTED] (Dennis browne) wrote:
> I want to display Japanese text on my site and am having many problems.
> 
> I am using Linux Redhat 8, PHP 4.2.
> 
> Basically what I have is a file page.php with the following code:
> 
> page.php:
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <META HTTP-EQUIV="Content-Language" content="ja">
> </head>
> <body>Home:<br>
> <?php
> include("lng_page_ja.php"); 
> 
> echo "home in japanese:"; 
> echo "<br><br>$home"; 
> 
> ?> 
> </body>
> </html>
> 
> I then have an include file with the Japanese text assigned to the
> variable $home.
> 
> lng_page_ja.php:
> <?php
> $home = "繝帙?繝"; 
> 
> ?> 
> 
> This should output the japanese characters for Home. But all I get is
> garbage out.
> 
> Why?

Two things (at least):

It's either you're not encoding your files properly or you're not 
encoding your files properly :)

But seriously, you have to make sure that your files are encoded 
correctly. For example, if you're using

 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

you have to make sure that you're files were edited and saved as "utf-8".

If you're using shift-jis, then save as "sjis". If you're using euc-jp, 
then save as "euc-jp"... (Unless, of course, you're doing some encoding/
decoding inside your script or somewhere else...)

HTH,

- E -

PS
Btw, you've got a wrong character in your Japanese "home" -- you've 
written "ho-mo" ("ホーモ") instead of "ho-mu" ("ホーム")  ;)

...[snip]...
。Š.aィh。?「€A澗k。ァ[jw[ノ?「?カŸÿmシ嚀Š「:

Reply via email to