Saturday, March 8, 2008

The character power unleashed

Written by
Xtreme Great
(for k0r0pt)

Introduction


The ASCII characters were invented, to give the world a way to write. But, soon it was realized, that a more vast and varied character set has to be incorporated, in order to meet the needs of various scripts around the globe. So, the UNICODE came into picture.

Tech details

Whereas the ASCII character is one byte long, the Unicode is two bytes long. That means, where the ASCII can store 256 characters at max, Unicode can store 65536 characters. This gives enough space to incorporate all the possible characters in any language.

More details


Here, I shall use Unicode characters to display some bangla characters. If you don't see them or see some boxes or question marks, try changing the character encoding of your browser to Unicode (UTF-8). In Firefox, it will be under the View menu. In Internet Explorer, it will be in the right click menu.


আমার নাম সুদীপ্ত

That of course means, my name is "you know what...". Now I am not going to tell you how I did that. If you really want to know, check out the page source. All I can tell here, is that I directly used the codes for the characters. You can possibly create any kind of character using Unicode. Just use your imagination. You of course, do need to have the Character chart. You can print, say, chess characters, or even a chess board, using Unicode.















So you see, Unicode gives us the ultimate power needed to write anything we want.


For Programmers

Unicode has been utilized in programming languages as well. The wide character functions like wprintf(), wscanf() etc would carry out operations in wide characters, of which Unicode is the most prevalent type. I won't go into details of those here. It will a long one that way. If you really need to know, just Google it out. You'd find answers. In Windows, Unicode is supported in many applications. All browsers of present day are Unicode compatible. So the next time you need to write out something regional in your program, do use these functions.

Epilogue

Well, that's all folks! Happy Unicoding.

No comments: