Documentation
¶
Overview ¶
Command gen generates ebcdic_tables.go, the EBCDIC code pages built into the transcode package, from the mapping files of the ICU project.
Run it from the root of the module, through go generate or directly:
go run ./internal/gen [-ucm dir] [-out ebcdic_tables.go]
The mapping files are downloaded from a fixed commit of the ICU data repository, or read from dir when -ucm is given. A page is taken from the table that IBM publishes for it (ibm-*.ucm); the files that the GNU C library contributed to ICU (glibc-*.ucm) are used only for pages that IBM tables do not cover.
Round-trip mappings (|0) define the character of each byte. Reverse fallbacks (|3) define the character of a byte that is decoded but never encoded: the page places the character at another position as well. Other mappings only serve encoding by approximation and are left out, as golang.org/x/text does. Any line that the generator does not understand stops it.
Source Files
¶
- main.go