Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 7
Registered: ‎05-13-2012
My Device: Developer

Detect character set

Hi guys,

 

I was wondering is there a way to detect the character set? For example detect whether the characters are Chinese or English?

 

Thanks.

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Detect character set

I think the answer here is "it depends". 

 

In what circumstances are you wanting to do this? 

New Contributor
Posts: 7
Registered: ‎05-13-2012
My Device: Developer

Re: Detect character set

I just want to know whether characters users has entered are chinese characters or alphanumeric characters
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Detect character set

I am not aware of a way to check this given a String. 

 

However you might be able to do this by checking each character. 

 

Look at the Character and Characters class.  do the methods in there help?

 

Remember that the characters entered are Unicode, so you might be able to check the values directly too.