mirror of
https://github.com/depp/syncfiles.git
synced 2024-11-25 08:30:55 +00:00
ca074ce387
The generation tool creates a GetCharmap function in C which takes the script and region as input and returns the charmap index. |
||
---|---|---|
.. | ||
charmap | ||
.gitignore | ||
data.go | ||
go.mod | ||
go.sum | ||
main.go | ||
README.md | ||
scriptmap.go |
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.