summaryrefslogtreecommitdiff
path: root/src/iso6937.py
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-30 16:17:40 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-30 16:17:40 +0100
commit2a85e711df07e8a707cfc50667bd0a29d8a09519 (patch)
treeb89200eeda155787d91e5cc0ab8044c93b3225cb /src/iso6937.py
parenta4114c49aeec1e24e0607814a88f0f6a2d6111f5 (diff)
Encode to ISO6937 on the way into STL binary.
Diffstat (limited to 'src/iso6937.py')
-rw-r--r--src/iso6937.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/iso6937.py b/src/iso6937.py
index 4719b07..ecce4dc 100644
--- a/src/iso6937.py
+++ b/src/iso6937.py
@@ -94,26 +94,28 @@ namespace iso6937 {
"""
groups = [
- ('GRAVE', 'grave', 'AEIOUaeiou'),
- ('ACUTE', 'acute', 'ACEILNORSUYZacegilnorsuyz'),
- ('CIRCUMFLEX', 'circumflex', 'ACEGHIJOSUWYaceghijosuwy'),
- ('TILDE', 'tilde', 'AINOUainou'),
- ('MACRON', 'macron', 'AEIOUaeiou'),
- ('BREVE', 'breve', 'AGUagu'),
- ('DOT ABOVE', 'dot', 'CEGIZcegz'),
- ('DIAERESIS', 'diaeresis', 'AEIOUYaeiouy'),
- ('RING ABOVE', 'ring', 'AUau'),
- ('CEDILLA', 'cedilla', 'CGKLNRSTcklnrst'),
- ('DOUBLE ACUTE', 'double_acute', 'OUou'),
- ('OGONEK', 'ogonek', 'AEIUaeui'),
- ('CARON', 'caron', 'CDELNRSTZcdelnrstz')
+ (0xC1, 'GRAVE', 'grave', 'AEIOUaeiou'),
+ (0xC2, 'ACUTE', 'acute', 'ACEILNORSUYZacegilnorsuyz'),
+ (0xC3, 'CIRCUMFLEX', 'circumflex', 'ACEGHIJOSUWYaceghijosuwy'),
+ (0xC4, 'TILDE', 'tilde', 'AINOUainou'),
+ (0xC5, 'MACRON', 'macron', 'AEIOUaeiou'),
+ (0xC6, 'BREVE', 'breve', 'AGUagu'),
+ (0xC7, 'DOT ABOVE', 'dot', 'CEGIZcegz'),
+ (0xC8, 'DIAERESIS', 'diaeresis', 'AEIOUYaeiouy'),
+ (0xCA, 'RING ABOVE', 'ring', 'AUau'),
+ (0xCB, 'CEDILLA', 'cedilla', 'CGKLNRSTcklnrst'),
+ (0xCD, 'DOUBLE ACUTE', 'double_acute', 'OUou'),
+ (0xCE, 'OGONEK', 'ogonek', 'AEIUaeui'),
+ (0xCF, 'CARON', 'caron', 'CDELNRSTZcdelnrstz')
]
for g in groups:
- setup(g[1])
+ setup(g[2])
print>>output_c,"map<char, wchar_t> sub::iso6937::main;"
+print>>output_c,"map<char, map<char, wchar_t> *> sub::iso6937::diacriticals;"
print>>output_h,"extern std::map<char, wchar_t> main;"
+print>>output_h,"extern std::map<char, std::map<char, wchar_t> *> diacriticals;"
print>>output_c,"""
void
@@ -123,7 +125,7 @@ sub::make_iso6937_tables ()
"""
for g in groups:
- fill(g[0], g[1], g[2])
+ fill(g[1], g[2], g[3])
print>>output_c,"\tmain[10] = 0x000A;"
@@ -220,6 +222,10 @@ print>>output_c,"\tmain[252] = 0x00FE;"
print>>output_c,"\tmain[253] = 0x0167;"
print>>output_c,"\tmain[254] = 0x014B;"
print>>output_c,"\tmain[255] = 0x00AD;"
+print>>output_c,""
+
+for g in groups:
+ print>>output_c,"\tdiacriticals[%s] = &%s;" % (hex(g[0]), g[2])
print>>output_c,"}"
print>>output_h,""