Commit Graph

10 Commits

Author SHA1 Message Date
Dietrich Epp
ca074ce387 Write conversion from script and region to charmap
The generation tool creates a GetCharmap function in C which takes the
script and region as input and returns the charmap index.
2022-03-15 14:31:12 -04:00
Dietrich Epp
e901b5baaa Parse script and region constants as numbers
This simplifies code generation, since we don't have to worry about what
happens if two symbolic constants have the same value.
2022-03-15 13:51:23 -04:00
Dietrich Epp
022d11fa14 Parse character map information
This adds associations between scripts, regions, and character maps, and
parses them from a Go utility.
2022-03-15 13:38:45 -04:00
Dietrich Epp
faa2460468 Add charmap parser 2021-12-14 23:48:47 -05:00
Dietrich Epp
db4187b65b Refactor table generator, handle line breaks
Extract table generation to its own file, table.go, and refactor the
interface. This exposed an inconsistency in the way that line breaks
were handled: both CR and LF on the Mac side were mapped to LF on the
UTF-8 side, but when the conversion table was inverted, the reverse
mappings would conflict. Previously, there was no explicit handling for
it, and whichever Mac charecter had a higher byte value would take
precedence. Conflicts are now detected and return an error, so line
breaks must be mapped explicitly. The new code maps CR, LF, and CRLF to
CR when converting UTF-8 to Mac.
2021-12-14 13:12:52 -05:00
Dietrich Epp
d77ccf009e Extract packbits into separate repository 2021-12-14 12:23:14 -05:00
Dietrich Epp
f39ab85222 Ignore conversion table generator binary 2021-12-14 11:01:37 -05:00
Dietrich Epp
c058e68d93 Add README for table generator
GitOrigin-RevId: 8062aa48890eb74a92b3322fdf306df9e5ecdee2
2021-03-17 21:05:19 -04:00
Dietrich Epp
1315f49c1e Add flags for debugging charset conversion tables
GitOrigin-RevId: d993358c037d8edd00d5819cac852c7822a89d3f
2021-03-17 21:05:18 -04:00
Dietrich Epp
9945fc0383 Add generator for UTF-8 to Macintosh tables
GitOrigin-RevId: 96f2909330b94c895688bfa2f5b50c3e4408fe54
2021-03-17 21:01:04 -04:00