Showing posts with label unicode. Show all posts
Showing posts with label unicode. Show all posts

Monday, September 8, 2008

Unicode revisited

Okay I didn't get any better topic today to discuss about. This one is another post about the UTF-8. Unicode is a powerful tool. Indeed. I figured out one more great way to type what I want in Hindi or Bangla, without actually installing a program for that. I installed language supports in Ubuntu. The same can be done from somewhere called "Regional Settings" in control panel if you're using windows. I am using phonetic Hindi keyboard option (whatever you call it).



I am going to type the same thing in English, Hindi and Bangla.



I am Sudipto. I study in NIT Raipur in Computer Science.


मेरा नाम सुदीप्तो है। मै एन आई टी रायपुर मे पढता हू।


অামার নাম সুদীপ্ত। অামি এন অাই টী রায়পুরে পরি।



So you see, UTF-8 standard is so powerful, and here I am once again, demonstrating what all we can do with it. We can even chat in our language, provided the application does support UTF-8. Gtalk and Pidgin and Yahoo messenger do support it.

Sunday, March 9, 2008

A Unicode chart generator

Written by
Xtreme Great
(for k0r0pt)

For those of you, that want a complete unicode chart, well why not just generate your own, that will have all possible unicode characters. Here goes a simple C program, that will generate an HTML file showing all unicode characters that can be.

#include<stdio.h>

int main(){
unsigned long i;
printf("<html><head><title>The complete character chart"
"<body><font size=13>");
for(i=0; i<=65535; i++)
printf("%ld: &#%ld <br>", i, i);
printf("</span></body></html>");
return 0;
}

Make this file and then execute it from the command line. While execution, just pipe out the output to an external file, say ucc.htm. This will generate a 1.16MB html file. If you don't know how to pipe out the output to a file, just leave a comment. This html file will contain all possible unicode charaters. If it shows question marks or Boxes, just change the encoding to Unicode(UTF-8), as directed in the previous post.

This however shows abnormal behavior after 8238, in the sense that the numbers are written from right to left rather than left to right. That is after 8238, comes 9328. Read that in the other direction. In many, the character is written first and the number after that. I believe this is caused due to some cr or lf or something.

Before I finish, I'd give one more advice. Don't get freaked out, if your browser stops responding. Instead wait for some time. It will get okay. It's doing that because of the huge size of the file, that it normally doesn't encounter in normal cases. Happy unicoding...

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.