• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Code Points and Code Units

 
Ranch Hand
Posts: 47
PHP C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to learn these but got confused.

This program gave 62 errors when compiled with command prompt, all of them were illegal expression. I saved the file in UNICODE format.
But when I compiled it using NetBeans there were no errors and the output was 5 , 5 instead of 5 , 6.

The symbol ♭ is represented by two code units or code points?
Whats the difference between code oints and code units?
What is surrogate area?

Please explain.... Thanks..

 
Ranch Hand
Posts: 62
Ruby Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GIYF http://weblogs.java.net/blog/joconner/archive/2005/08/how_long_is_you.html
 
Marshal
Posts: 77282
371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The program ran first time on my terminal and printed 5 , 5.
To find out the ♭ symbol, you would have to go to the Unicode Index and look up “flat”; if it is ≤ 0xffff then it is one code point.
 
Sagar Dabas
Ranch Hand
Posts: 47
PHP C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we store supplementary characters in char type......Please explain

I don't know how to type supplementary characters , so I can not check it myself.

Thanks.....
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sagar Dabas wrote:Can we store supplementary characters in char type


No, but Java Strings can handle supplementary characters as a "surrogate pair". I suggest you look at the documentation for java.lang.Character, and particularly the isHighSurrogate() and isSurrogatePair() methods. This page also contains a glossary of useful terms.

Winston
 
Sagar Dabas
Ranch Hand
Posts: 47
PHP C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all... you guys are really helpful..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic