• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Unicode

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Is there any method in java which gives us the Unicode of any particular character. Please let me know. like suppose if we input 'A' it should return the Unicode value \u0041 for it.
If there isn't any method, then is there any way that we will be able to know the Unicode Values of characters.
thanks
Chandrashekar!
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by chandrashekar munukutla:
Hi all,
Is there any method in java which gives us the Unicode of any particular character. Please let me know. like suppose if we input 'A' it should return the Unicode value \u0041 for it.
If there isn't any method, then is there any way that we will be able to know the Unicode Values of characters.
thanks
Chandrashekar!


I don't know whether there hava such kind of method, I only know some mapping between unicode and ASCII code. Hope this can help a little:
ASCII digits 0-9 (\u0030-\u0039) ��
ASCII Latin letters A-Z (\u0041-\u005a) ��
ASCII Latin letters a - z (\u0061-\u007a) ��
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by fengzixuan zheng:
I don't know whether there hava such kind of method, I only know some mapping between unicode and ASCII code. Hope this can help a little:
ASCII digits 0-9 (\u0030-\u0039) ��
ASCII Latin letters A-Z (\u0041-\u005a) ��
ASCII Latin letters a - z (\u0061-\u007a) ��



Hi Fengzixuan zheng,
I can get this info from Khalid's book. Or may be from few other java text books.
Can anybody help!
Anyway thanks.
Chandrashekar!
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi chandrashekar,
I'm not aware of a method. I'm going to move this over to Java in General Intermediate. Maybe some there can help.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A char in already a numeric type - as far as Java is concerned, it already is a Unicode value. You can force Java to display this for you by casting:
<pre> System.out.println((int) 'A');</pre>
or
<pre> String str = Integer.toString('A');</pre>
 
I'm doing laundry! Look how clean this tiny ad is:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic