aspose file tools
The moose likes Java in General and the fly likes Identify Unicode chars in string Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Identify Unicode chars in string" Watch "Identify Unicode chars in string" New topic
Author

Identify Unicode chars in string

Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
Guys,

I am reading data from an CSV file and this CSV can contains special chars (like "Mich�le") aswell in some records.

I am getting all hte records in csv file in an array of Strings.
Can any one tell me how can I identify a string inside this array is of Unicode/special chars. any method in Java to identify this??
thanks & regards,
Mahesh
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
Well, I believe all characters in Java are already Unicode, what you seem to be looking for is if the character belongs to a particular subset of Unicode, not just to the ASCII Subdomain.

Maybe the java.lang.Character.UnicodeBlock class may be useful to your purpose. It has method that given a char can tell you what its UnicodeBlock is, or you could simply test what is the number or the code point of the unicode char and see if it is out of the scope of the ASCII characters.

The class Character also offers some interesting methods. Take a look at it.


[ October 25, 2006: Message edited by: Edwin Dalorzo ]
Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
Edwin,
Thanks for your reply. it worked for me..
regards,
Mahesh P
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Identify Unicode chars in string
 
Similar Threads
Read Unicode chars and insert into Oracle DB
convert an array of String to char
using BufferedReader and looping
Problem While storing Chinese Chars In db.
BITS, Bytes, char, String