Move files around to prepare for assimilation into core
[libs/core.git] / jis.py
diff --git a/jis.py b/jis.py
index d28cd8094f51b6e28d7233777e8269a36dff560e..f8a173b74c4d2d75058ac19fea02c6d94b0bf8d7 100755 (executable)
--- a/jis.py
+++ b/jis.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# $Id$
 
 import sys
 import os
@@ -12,13 +13,14 @@ for line in file(in_fn):
        if line[0]=='#':
                continue
        parts=line.split(None, 3)
-       code=eval(parts[1])
-       code2=((code&0xFF)-0x21)+(((code>>8)&0xFF)-0x21)*94
+       code=eval(parts[1])-0x2020
+       code2=(code&0xFF)+((code>>8)&0xFF)*94-95
        data.append((code, eval(parts[2]), code2))
 
 out=file(out_fn, "w")
 out.write("namespace {\n\n")
 
+data.sort(lambda x,y: cmp(x[0],y[0]))
 out.write("const unsigned short jisx0208_to_ucs_table[94*94] =\n{\n\t")
 i=0
 for code in xrange(94*94):