#!/usr/local/bin/perl -w #This script prints HTML character entities &#number;. #Usage: this_script > char.html #The line below can be used in a CGI script to send the HTTP header in place of #the HTML tag. #print "Content-type: text/html; Accept-Charset: 'UTF-8'\n\n"; #You can force fixed width on most characters by using #span {background-color:white;font-family:monospace;font-weight:bold} #in the style block below. But overlapping characters such as 777 no longer overlap. print "

This table is generated by char.pl. Each table cell contains character code in decimal, comma, character code in hexidecimal, character entity rendered in your browser using browser default font in UTF-8 charset. Characters may have different width. Some even take no space and overlap on previous characters (e.g. characters 768, 777 etc).

\n"; for ($h=1; $h<=10; $h++) #empty table header to define 10 columns per line { print ""; } print "\n"; #Change the $i range to anything between 0 and 6554. Since each line is 10 chars, #6554 means it goes to 4 more than 65536, the last char in 16-bit Unicode. for ($i=0; $i<368; $i++) { print ""; for ($j=1; $j<=10; $j++) { $code=10*$i+$j; #The print line below does real work. If you want to save on output file #size, you can even drop "" to inappropriately take advantage of #browsers' error tolerance. But my test shows that IE actually takes a #little longer instead of shorter to fully render the page! print ""; } print "\n"; } print "
", $code, (sprintf ",%lx", $code), "&#", $code, ";
";