Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi everyone;

 

I am in the process of creating my first website - for our department. However, since the site will be displayed both in Emglish and Japanese, I am running into character encoding problems. The test URL is

 

http://www.jaist.ac....test/index.html

 

The problem is mainly grave in safari and google chrome browsers. How can such problems be resolved? Will appreciate any comments.

 

Natt

Link to comment
Share on other sites

Heh! Interesting. You live in Japan, Natt?

Anyway, if you set the encoding to UTF-8, you should be fine.

Either add the tag between your head tags or add the header('Content-Type: text/html; charset=UTF-8') function to your PHP (but not both).

Link to comment
Share on other sites

Hi;

 

Thanks. Actually until March I used to live in Yokohama, Kannai. Now I am in Ishikawa.

 

Regarding the characters, I think that I have declared in the header that the character enchoding is UTF-8. But many of the trial viewers, including my boss, are reporting problems especially with the Japanese pages. You can take a look at the site and try viewing the Japanese pages. Also, you can view the character settings by viewing the code.

 

Regards.

 

Natt

Link to comment
Share on other sites

Oh, that's cool. I live in Aobadai in Yokohama and work in Totsuka.

I hear Ishikawa is great, but never been there.

Anyway, what browsers are your bosses using?

I'm stuck using the Japanese version of IE6 at work, but even so, I can see the Japanese on your pages just fine.

 

While this may not matter, since you're using XHTML, you might want to change the meta tag as follows:

 

<meta http-equiv="Content - Type" content="text/html; charset=utf-8" />
↓
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

 

That honestly will probably not make a difference, but it is more technically correct, which might make a difference with XHTML. Unfortuantely, I don't have the resources to test such things at work right now.

 

If you could maybe explain a bit more about the environment you and your bosses are using, we could possibly better help you resolve the problem.

Thanks.

Link to comment
Share on other sites

Hi;

 

Thanks. I am not sure of the term environment. However we all use different browsers: Google chrome, safari, Firefox (in my case), IE etc. So far firefox seem to experience the least amount of problems as it detects the Japanese characters. For Safari, the text must be set to utf-8 all the time. It doesnt work with the default setting of the encoding. For google chrome we are all lost and just trying to figure out what the problem could be. For IE we dont get problems when operating on the intranet mode. On the stricter internet mode the characters arent being detected automatically.

 

Does this help in any way?

 

Nat

Link to comment
Share on other sites

By "environment", I basically meant the browser/OS combo you're using.

Anyway, if the encoding is set to UTF-8, it should be fine in all browsers, which means there's something weird going on with someone's computer, or there's something you're not telling me.

In the case of Chrome, which seems to be the problem child, does the Japanese text not display regardless of the computer the browser is on? In other words, is it the browser or the computer that's the problem?

Also, when you say that the Japanese does not display, do you mean that the text gets all garbled (文字化け), or is it just not displayed at all?

 

I don't usually use XHTML, so I wonder if there's some weird compatibility issue with the XHTML doctype. If you don't mind, try out the following test script with Japanese in various browsers and report back the results. Thanks.

 

<!DOCTYPE html>

<html lang="ja">

 <head>

   <meta charset="UTF-8">

   <title>日本語文字テスト</title>

 </head>

 <body>

   <p>日本語の文字が正しく表示されているかどうかをテストします。</p>

   <p>文字化けになってしまったかなぁ。</p>

 </body>

</html>

Link to comment
Share on other sites

Hi;

 

Thanks for all the input. The key was the lang="ja" in the header. Now most of the browsers are OK with a few glitches.

 

I will work on those for now.

 

Thanks once again.

 

Natt

Link to comment
Share on other sites

 Share

×
×
  • Create New...