Jump to content


Photo

How do I convert Unicode values to characters?


  • Please log in to reply
3 replies to this topic

#1 allare

allare

    Honourable Member

  • Members
  • PipPipPipPip
  • 658 posts

Posted 28 February 2003 - 02:54 PM

I need to convert between characters of a nepali language and their Unicode values. How should I do this in java?

Please help!

#2 linuxuser

linuxuser

    Honourable Member

  • WNSO Addict
  • PipPipPipPip
  • 1,147 posts

Posted 28 February 2003 - 04:19 PM

hey allare.............
nepali characters................assuming u are using Devanagari characters ( well u can use others too), Devanagari falls into a range of 0900-097F.
You should be able to use java.lang.Character class...which is derived from java.lang.Object.
and use its method getNumericValue to convert the character to its corresponding unicode numeric value.
method is declared as this.
public static int getNumericValue( char ch);
Returns the Unicode numeric value of the character as a nonnegative integer. If the character does not have a numeric value, then -1 is returned. If the character has a numeric value that cannot be represented as a nonnegative integer (for example, a fractional value), then -2 is returned.
:)

#3 allare

allare

    Honourable Member

  • Members
  • PipPipPipPip
  • 658 posts

Posted 04 March 2003 - 04:19 PM

thanks rs_1915 for answer. I got it now.

#4 kamal

kamal

    Senior Member

  • WNSO Addict
  • PipPipPip
  • 358 posts

Posted 04 March 2003 - 04:40 PM

very nice question. i like it but have no answer for the question. once one of my friend had asked same question couple years ago. by the way, could we see your out put .

thanks
:::::::::::Life is beautiful:::::::::::




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users