aspose file tools*
The moose likes Java in General and the fly likes Identifying Japanese Character. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Identifying Japanese Character." Watch "Identifying Japanese Character." New topic
Author

Identifying Japanese Character.

Gaurav Mac Mathur
Ranch Hand

Joined: Feb 19, 2002
Posts: 47
How can we Identify if the String has Japanse Characters. One way can be picking Charcater by Character and Identifying if thet Lie between 30A0-30FF and 3040-309F. but this is Crude. Is there any facility available with Java to do this?
Cheers
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If there were such a facility, it would have to examine each character anyway. However I do not know of one, so you would probably be best to do it this way yourself.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
You could do something like this:

You'll have to look at the API for Character.UnicodeBlock to make a more complete list of blocks. And many of the chars you need are in various CJK blocks (Chinese/Japanese/Korean unified) which means that they may contain some chars that aren't really appropriate to Japanese-only usage. I think. This is a muddy issue which I don't understand much. I think you'll need to test using a lot of data, and consulting with people who know the language well (assuming you do not) to be sure your list of chars is appropriate.


"I'm not back." - Bill Harding, Twister
Gaurav Mac Mathur
Ranch Hand

Joined: Feb 19, 2002
Posts: 47
Thanks Jim,
This was exactly what i wanted to do.

Cheers
Gaurav
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
This was exactly what i wanted to do.
Wel, make sure you've gone through the whole list of "CJK" blocks before you say that. I have no idea what they all do, but if they say CJK they probably have something to do with Japanese...
 
Consider Paul's rocket mass heater.
 
subject: Identifying Japanese Character.