aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/map/mk_ucs_case_map.pl
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:45:29 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:45:29 +0000
commit2945f70be161735bf7efaefde43125a9ad3a4c88 (patch)
treeda85d4bca39cba5a7c4e6714c8b73d6a8cd547fe /libwc/map/mk_ucs_case_map.pl
parentReleasing debian version 0.5.2-10 (diff)
downloadw3m-2945f70be161735bf7efaefde43125a9ad3a4c88.tar.gz
w3m-2945f70be161735bf7efaefde43125a9ad3a4c88.zip
Releasing debian version 0.5.3-1debian/0.5.3-1
Diffstat (limited to 'libwc/map/mk_ucs_case_map.pl')
-rw-r--r--libwc/map/mk_ucs_case_map.pl48
1 files changed, 48 insertions, 0 deletions
diff --git a/libwc/map/mk_ucs_case_map.pl b/libwc/map/mk_ucs_case_map.pl
new file mode 100644
index 0000000..ee48826
--- /dev/null
+++ b/libwc/map/mk_ucs_case_map.pl
@@ -0,0 +1,48 @@
+
+open(MAP, "> ucs_case.map");
+print MAP <<EOF;
+/*
+ File generated from UnicodeData-4.1.0.txt.
+*/
+
+EOF
+
+for (<DATA>) {
+ chop;
+ ($name, $col) = split;
+
+ @cp = ();
+
+ open(UCD, "< private/UnicodeData-4.1.0.txt");
+ while(<UCD>) {
+ chop;
+ @entry = split(';');
+ last if $entry[0] =~ m/.{5,}/;
+ if ($entry[$col] ne '') {
+ push (@cp, $entry[0]);
+ $map{$entry[0]} = $entry[$col];
+ }
+ }
+ close UCD;
+
+ $nocp = @cp;
+
+ print MAP <<EOF;
+
+#define N_ucs_${name}_map ${nocp}
+
+static wc_map ucs_${name}_map[ N_ucs_${name}_map ] = {
+EOF
+
+ for (@cp) {
+ print MAP " { 0x$_, 0x$map{$_} },\n";
+ }
+ print MAP <<EOF
+};
+EOF
+}
+
+__END__
+toupper 12
+tolower 13
+totitle 14