syncfiles/gen
Dietrich Epp f49e81388c Generate charmap string resources
The string resources contain names of scripts, regions, and character
maps.
2022-03-15 15:34:39 -04:00
..
charmap Add charmap parser 2021-12-14 23:48:47 -05:00
.gitignore Parse character map information 2022-03-15 13:38:45 -04:00
data.go Parse script and region constants as numbers 2022-03-15 13:51:23 -04:00
go.mod Parse character map information 2022-03-15 13:38:45 -04:00
go.sum Parse character map information 2022-03-15 13:38:45 -04:00
main.go Generate charmap string resources 2022-03-15 15:34:39 -04:00
README.md Add README for table generator 2021-03-17 21:05:19 -04:00
rez.go Generate charmap string resources 2022-03-15 15:34:39 -04:00
scriptmap.go Write conversion from script and region to charmap 2022-03-15 14:31:12 -04:00

Character Conversion Tables

Used by SyncFiles.

This program generates the tables necessary to convert from UTF-8 to Mac OS Roman.

The conversion process is entirely table-driven. The table maps a (state, input) pair to a (state, output) pair. The initial state is 0. A transition to state 0 is considered invalid.

A transition may have both a state and output. This means that the input may be translated in different ways depending on the bytes that follow. The translation code prefers the longest path through the state table that results in an output.

The table is compressed with PackBits to reduce its size by a factor of 22x.