desultory / ugrd

A minimalistic initramfs generator, designed for FDE
GNU General Public License v2.0
37 stars 13 forks source link

keymap: Ignore utf-8 decoding errors #113

Closed shuber2 closed 3 weeks ago

shuber2 commented 3 weeks ago

The keymap module scans keymap files for include directives to identify further keymap files to be included. Keymap files, however, have different encodings. The default "utf-8" of decode() produces errors when an invalid character is found, say, when a ISO-8859 character is found.

This is, for instance, the case for keymaps/i386/include/compose.inc in the upstream repository, causing ugrd to fail. Greetings to Bernhard Rosenkränzer.

Add an option to decode() to ignore errors, which should be safe assuming that the include directives are not affected. A more involved solution would be to use the 'magic' package for the 'file' utility.

desultory commented 3 weeks ago

Thank you!