3 # The following script converts Blocks.txt
4 # (http://unicode.org/Public/UNIDATA/Blocks.txt)
5 # to the character range definitions of LuaTeX-ja.
7 # USAGE: ruby blocks2defcharrange.rb > unicodeBlocks.tex
10 open("Blocks.txt", "r").each_line {|line|
17 if line =~ /([0-9a-f]+)\.\.([0-9a-f]+); (.*)/i
21 print "\\defcharrange{", count
22 print "}{\"", bcharcode, "-\"", echarcode, "} % ", blockname, "\n"