• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unicode Character

 
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.fileformat.info/info/unicode/char/633/index.htm

C/C++/Java source code "\u0633"
HTML Entity (decimal) س
Python source code u"\u0633"

It is only one character, But in each case has its own code.I want to know how this character in java has this code: "\u0633" and what does this code mean?
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abalfazl hossein wrote:http://www.fileformat.info/info/unicode/char/633/index.htm

C/C++/Java source code "\u0633"
HTML Entity (decimal) س
Python source code u"\u0633"

It is only one character, But in each case has its own code.


All the above code points to unique Unicode 0633, except HTML as its converted to decimal value.

abalfazl hossein wrote:I want to know how this character in java has this code: "\u0633" and what does this code mean?


In Java, when you passed something like this "\uXXXX", the Java interpreter treat it as Unicode and try to convert it into the specific character which eventually rendered by the graphical window you are using.
More info on JLS: http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to know what code maps to what character, then look at the Unicode website: Unicode Charts.
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abalfazl hossein wrote: . . . C/C++/Java source code "\u0633" . . .

In Java™, "\u0633" does not mean the character س; it means a String containing the single character س.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

n Java™, "\u0633" does not mean the character س; it means a String containing the single character س.



But in the link it matches only by س

Do you mean that one sentence match to "\u0633"?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"\u0633" is a String with only one character. That character is '\u0633'. Note the difference in double and single quotes.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA uses UTF-16 to save characters. in UTF-16 س is 0633, But as I see there is u0633...

does it mean java has its own encoding?

How the س convert to u0633 in java?
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abalfazl hossein wrote:. . . does it mean java has its own encoding? . . .

No
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abalfazl hossein wrote: . . . How the س convert to u0633 in java?

Not at all. When you push the س key on your keyboard, it doesn't sent a س, but the binary equivalent of 0x0633 (0000_0110_0011_0011). Java™ records that as the number 0x633 in binary. It is the screen and graphics and Unicode records associated with Java™ which take 0x0633 and display س.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic