Using charmap and calc to find your favorite HTML Entities.

Did a funny experiment today, which begins from a question: what if I wanted to find a certain HTML entity for a strange character (say, © for the copyright char ©), but at the same time I'm too lazy to find the info somewhere in the internet (or probably being offline)?

Enter charmap and calc. Of course, I assume most of you run Windows; I don't know what's the equivalent of these progs in other OS's.

It's simple, really. First you open up charmap (Start > Run.. and then type 'charmap' and enter). Next, find that strange character you'd like to enter.

Done? Now look at the text at the bottom left corner. It will have something like 'U+00A9: Copyright Sign'. Ignore everything but the numbers: you have '00A9', which is a hex number. You don't really have to understand what a hex number is, so don't worry.

Next, run calc and go into Scientific Mode (View > Scientific). At the left hand side you should see a panel with four options, 'hex | dec | oct | bin'. Pick the 'hex' one. Next, input that number we get from charmap into the calc.

Now choose the 'dec' option. You will see that the number you entered earlier changes into a different number. That's our HTML entity number. To use it inside your HTML, simply add '&#' at the beginning and ';' at the end of that number. Our end result would be ©, which is indeed the HTML entity for the copyright sign.

And that's it. I'm not sure if every character in charmap has its own HTML entity code, but rather than being doubtful simply give it some test, test, test and see if it works.

posted@9:13 AM

Comments & Discussion

»Anonymous Anonymous

useful, might will need it sometime soon :)

9:10 AM 
Post a Comment