Learn Japanese with JapanesePod101.com

View topic - Japanese in html

Japanese in html

NO SPAM ALLOWED! Discuss stuff not related to Japan or Japanese. The rules are the same in this forum as in the other forums.

Japanese in html

Postby noisyturtle » Sun 02.18.2007 12:39 am

Does anyone know how to put in Japanese when using html for a website? I have been looking but haven't figured out how to do it yet.
noisyturtle
 
Posts: 20
Joined: Thu 01.11.2007 1:46 am

RE: Japanese in html

Postby Ueshu » Sun 02.18.2007 1:28 am

I hardly know anything about html itself, but I would say that they use Japanese text, and instert the English mark-ups when needed.

i.e.: [img]米[/img]

That's how I would think they would use it.
Look to the skies and you'll find the heavens.
User avatar
Ueshu
 
Posts: 32
Joined: Fri 06.23.2006 10:20 am
Location: U.S.

RE: Japanese in html

Postby Ueshu » Sun 02.18.2007 1:30 am

Oops, that didn't work. ごめなさい。 Sorry.
Look to the skies and you'll find the heavens.
User avatar
Ueshu
 
Posts: 32
Joined: Fri 06.23.2006 10:20 am
Location: U.S.

RE: Japanese in html

Postby zengargoyle » Sun 02.18.2007 1:43 am

noisyturtle wrote:
Does anyone know how to put in Japanese when using html for a website? I have been looking but haven't figured out how to do it yet.


can you be more clear? as it is, your question doesn't make much sense.

are you asking:

1. how do i put an html page on my website with Japanese in it?
2. how do i enter Japanese text in a textbox on some random web page?
3. some other question...
User avatar
zengargoyle
 
Posts: 1200
Joined: Sun 05.29.2005 10:16 pm

RE: Japanese in html

Postby richvh » Sun 02.18.2007 2:44 am

If it's 1), then type up the document with the appropriate Japanese, save it in an encoding that is Japanese-capable (such as UTF-8), then put the encoding in the heading, like this:

Code: Select all
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>ゆきの物語</title>
</head>
Richard VanHouten
ゆきの物語
richvh
 
Posts: 6450
Joined: Thu 09.29.2005 10:35 pm

RE: Japanese in html

Postby zengargoyle » Sun 02.18.2007 3:28 am

even 1) doesn't necessarily hold.... if you're using CGI scripts of various sorts (PHP/Perl/etc) to generate your pages, or if your web server is not configured to parse the meta-tags within the output.

the character set of a response, if set in the HTTP headers, overrides any declaration in the response data itself. if your server is not setup to parse the files before sending the HTTP headers then the meta-tag trick will not work. you'll have to either configure the server to parse the file for meta-tags, or use another method to set the appropriate Content-Type HTTP header. also, sometimes, the Content-Type meta tag must be the very first tag in the <head> section or it will not work.

with PHP and Apache on Linux, you need to take into account PHP's default charset, and Apache's configuration.... I've had to use the .htaccess file to override the charset:

<Files "heisig.html">
AddCharset UTF-8 .html
</Files>

for a single file, or for a whole directory:

AddDefaultCharset utf-8

so it all really depends on which web server you are using, which CGI scripting language you are using, and the configuration of each (web/cgi) as to what is default, and whether or not the output is scanned for the meta tags in the head section.... the sad truth is that sometimes the meta tag solution just doesn't work. :(
User avatar
zengargoyle
 
Posts: 1200
Joined: Sun 05.29.2005 10:16 pm

RE: Japanese in html

Postby keatonatron » Sun 02.18.2007 4:24 am

But the good news is any respectable web hosting company will have their servers set up to allow any language, so just adding the tags like Rich showed should work fine. ;)

Don't let Zen confuse or depress you!
User avatar
keatonatron
 
Posts: 4838
Joined: Sat 02.04.2006 3:31 am
Location: Tokyo (Via Seattle)
Native language: English
Gender: Male

RE: Japanese in html

Postby zengargoyle » Sun 02.18.2007 4:36 am

hehe, respectable... you're just as likely that your hosting company has set everything up to default to 'latin-1' or some such and have a hell of a time getting anything non-ASCII to display at all.... and/or they have 'AllowOverride None' in the configs so that your .htaccess files don't work at all. :(

but yes, if you are not unlucky, Rich's answer will work :)

or you can always use HTML entities like 〹 to insert any Unicode character you like into your page... (but this doesn't always work for the #2 question since some sites filter out HTML entities).
User avatar
zengargoyle
 
Posts: 1200
Joined: Sun 05.29.2005 10:16 pm

RE: Japanese in html

Postby noisyturtle » Sun 02.18.2007 12:58 pm

richvh wrote:
If it's 1), then type up the document with the appropriate Japanese, save it in an encoding that is Japanese-capable (such as UTF-8), then put the encoding in the heading, like this:

Code: Select all
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>ゆきの物語</title>
</head>



Thanks that worked. Sorry I wasn't clearer but I wanted to put Japanese text on a webpage I am making with html.
noisyturtle
 
Posts: 20
Joined: Thu 01.11.2007 1:46 am

RE: Japanese in html

Postby Kdar » Mon 02.19.2007 2:23 pm

Just like you put English. Only put Japanese instead of English text...... thats all.

Who ever have things installed to see Japanese text, will see it on your page.
Last edited by Kdar on Mon 02.19.2007 2:24 pm, edited 1 time in total.
User avatar
Kdar
 
Posts: 278
Joined: Fri 01.12.2007 5:37 pm


Return to General off topic

Who is online

Users browsing this forum: No registered users and 2 guests

cron