Unicode isn't particularly a 'java' concept so much as something incorporated into java. As ciderpunx pointed out, it's a replacement for ASCII that basically uses 16 bits (two bytes) to encode a character rather than 8 bits (1 byte). This provides 2^16 possible variations rather than 2^8, which some guys somewhere figured ought to be enough to encode just about every character in every alphabit known to man. Lots of operating systems use unicode internally now too. But unicode is backwardes-compatbile with ansi .. here's an example:
(ASCII Encoding of letter 'a')
character binary decimal
a 01100001 61
(UNICODE Encoding of letter 'a', periods indicate byte boundaries)
a 00000000.01100001 0.0
As you can see, the first byte of the unicode 'a' is all zeros, the second byte is the same as the ASCII value.
Regards,
Meredith Shaebanyan
|