aspose file tools*
The moose likes Beginning Java and the fly likes Unicode Character Values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unicode Character Values" Watch "Unicode Character Values" New topic
Author

Unicode Character Values

Aran Winters
Greenhorn

Joined: Nov 23, 2003
Posts: 11
Hello,

I am trying to convert between integers and characters for the purpose
of writing a class to sort strings alphabetically.

I found a method to convert from character to integer
(--> java.lang.Character.getNumericValue() <--),
but have not been able to find a method which allows
be to provide an integer argument returning a character
(according to the Unicode value).

I have looked over the methods in the java.lang.Character
and java.lang.Integer classes, but was not successful in
finding what I need.

If someone could point me in the right direction I would
appreciate it.

Aran.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I'm not quite clear on what you are attempting to do. What kind of conversion are you trying to do? There are several kinds. For example the character 'A' has an underlying numerical value (I'm not sure what it is). Similarly all characters have a numerical value (as far as I know). On the other hand, you may be attempting to take the character '1' and get the integer value 1. I am sure that someone else can dream up yet another definition of "convert between integers and characters". Can you please give a more detailed description of what you want? Perhaps some examples to illustrate the expected input and output for this portion of your program will help clear things up.

Regards,

Layne


Java API Documentation
The Java Tutorial
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
If I understand you correctly, it's alot easier than you think

'A' == (char) 65
(int)'A' == 65


I've heard it takes forever to grow a woman from the ground
Aran Winters
Greenhorn

Joined: Nov 23, 2003
Posts: 11
Sorry I wasn't more clear,

I was trying to convert single chars ('A'), into their underlying
numerical values. I think the unicode values are offset differently,
but the second reply still does the trick. Thanks for all the
responses.

Aran.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unicode Character Values