Dear Maintainer,
The iconv program, following POSIX, allows charmap files to be used
directly for conversion without having to be compiled into a gconv
module. For example,
iconv -f ./palimpsest.charmap
This is a very handy feature as it allows end users to quickly make
custom mappings without needing to compile a gconv module.
Unfortunately, due to a simple bug (using the wrong hash table), iconv
scrambles the conversion when the char hash table is realloc'd.
Changing `char_table` to `byte_table` in iconv/iconv_charmap.c:339
will fix this. (Patch attached.)
An example file, palimpsest.char, that exercises this bug is also
attached.
Current version of iconv:
$ echo 0123456789 | iconv -f ./palimpsest.charmap
෦꩑꧒꧓४꘥꧖෭෮෯
Patched version of iconv:
$ echo 0123456789 | iconv -f ./palimpsest.charmap
0123456789