Thursday, November 04, 2004

UCS2 vs UTF-8

Now what you infer when I say UCS2. This may mean: You see an Ass too!! This was like a breeze of thought which blew over my mind when I first heard that. Then for few days or weeks or months or years I didn't care about it. "Who cares!" type attitude. But today, I just have to go deeper to understand what it actually means.

I (also) work for supporting local language requirements to my application, which is called Internationalisation in Java. Now, how the Java can understand if I'm writing in English or French or for that matter some characters in East Asia like those of Chinese, Thai languages where each representation of what is called glyph needs more bytes to represent themselves. So, UCS2 comes to our rescue and helps us out.

UCS2 represents each charcter in 2 bytes. Each character is written in number representaion having 2 bytes. But this may be problem when you want to transfer the characters in a file like an xml message where the characters has to be in ASCII. This where UTF-8 format plays the hero.

Its the representation of characters in which it can be written in a file and sent across a protocol. But then this means the suppressing the information when the conversion happens from 2 octet to 1 octet (8 bit). So, there comes the role of Encoding (an easy place to see the encoding is the browser). This encoding helps to set the proper information like fonts, thier size etc to display the characters properly.

By the way, you may ask what the hell UTF-8 and UCS2 stands for? So here you go:

UTF-8 : Unicode Transformation Format-8

UCS2:
Universal Character Set - 2

4 Comments:

Anonymous Anonymous said...

Kyon bhai aajkal technical mood mein chal rahe ho kya... election waala blog aacha tha...

12:33 PM  
Anonymous Anonymous said...

Kyon bhai aajkal technical mood mein chal rahe ho kya... election waala blog aacha tha...

-- shrek

12:33 PM  
Anonymous Anonymous said...

ye ucs ucs kya hai ye ucs ucs...

12:40 PM  
Anonymous Anonymous said...

Technical mood kuch nahin, shrek. Just wanted to write something and sinc this took most of my day, so socha ki blog kar diya jaaye :)

2:13 PM  

Post a Comment

<< Home