| Author |
In Java : How to detect whether a character is chinese or not?
|
Rama Vadakattu
Greenhorn
Joined: Oct 12, 2007
Posts: 6
|
|
In java how to detect whether a particular character is chinese character or not? Can any one please guide me on how to solve the above problem?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
Try the String.codePointAt() methods, then Character.isSupplemntaryCodePoint(). Go to the Unicode website and find what ranges of values represent Chinese characters. Compare the results of getting the code point and the Unicode charts. And check the method names; I have probably spelt them wrongly.
|
 |
Rama Vadakattu
Greenhorn
Joined: Oct 12, 2007
Posts: 6
|
|
Thanks for the guidance to detect the chinese characters i used the following condition (detecting most of the chinese characters).......... ----------------- if( (Character.UnicodeBlock.of(str[i]) == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS) || ) ------------------- May be chinese,japnese characters fall into this UNICODE block Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS (not very sure) Important links http://forums.sun.com/thread.jspa?forumID=31&threadID=5341202 { [ October 25, 2008: Message edited by: Rama Vadakattu ]
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
|
Yes, that's right. "CJK" means "Chinese, Japanese, Korean". And of course many Japanese kanji characters are identical in appearance to Chinese characters, so there's probably no point in trying to tell them apart.
|
 |
 |
|
|
subject: In Java : How to detect whether a character is chinese or not?
|
|
|