How to detect whether a character is chinese or not in Java ?
To detect the chinese characters i have used the following condition (and it is 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)
Similarly
To identify any language characters (say arabic, hindi etc……….)
we need to know the unicode block name for that language and need to apply the similar condition as shown above.
See the below link for more details
http://forums.sun.com/thread.jspa?forumID=31&threadID=5341202
Advertisement
Leave a Comment