tags:

views:

623

answers:

4

Hi where can I get a list of Ascii codes corresponding to japanese kanji, hiraggana and katakana characters. I am doing a java function and javascript which determines wether it is a japanese character. What is its range in the ASCII code

+2  A: 

Japanese characters won't be in the ASCII range, they'll be in Unicode. What do you want, just the char value for each character?

Noon Silk
yup.I need the values for each character
cedric
+5  A: 

ASCII stands for American Standard Code for Information Interchange, only includes 128 characters (not all of them even printable), and is based on the needs of American use circa 1960. It includes nothing related to any Japanese characters.

I believe you want the Unicode code points for some characters, which you can lookup in the charts provided by unicode.org.

Roger Pate
+4  A: 

Please see my similar question regarding Kanji/Kana characters. As @coobird mentions it may be tricky to decide what range you want to check against since many Kanji overlap with Chinese characters.

In short, the Unicode ranges for hiragana and katakana are:

  • Hiragana: Unicode: 3040-309F
  • Katakana: Unicode: 30A0–30FF

If you find this answer useful please upvote @coobird's answer to my question as well.

がんばって!

Zack Mulgrew
A: 

I think what you mean by ASCII code for Japanese is the SBCS (Single Byte Character Set) equivalent in Japanese. For Japanese you only have a MBCS (Multi-Byte Character Sets) that has a combination of single byte character and multibyte characters. So for a Japanese text file saved in MBCS you have non-Japanese characters (english letters and numbers and common non-alphanumeric characters) saved as one byte and Japanese characters saved as two bytes.

Assuming that you are not referring to UNICODE which is a uniform DBCS (Double Byte Character Set) where each character is exactly two bytes. Actually to be more correct lately UNICODE also has multiple DBCS because the character set could not accomodate other character anymore. Some UNICODE character consiste of 4 bytes already having the first two bytes as leading character.

If you are referring to The first one (MBCS) that and not UNICODE then there are a lot of Japanese character set like Shift-JIS (the more popular one). So I suggest that you search Shift-JIS character map. Although there are other Japanese character set map aside from Shift-JIS.

Nassign
Unicode is *not* a “double byte character set”. Do not confuse encodings with the character set itself. The Unicode standard provides, among other things, a mapping between characters and numbers (‘code points’). When you talk about a “two byte Unicode”, you are probably referring UCS2 (two bytes per code point, can not represent all Unicode characters) or UTF-16 (two or four bytes per code point). Other encodings include UTF-32 (a four byte encoding) and UTF-8 (an encoding that uses one, two, three, or four bytes per code point).
Chris Johnsen