-
Notifications
You must be signed in to change notification settings - Fork 16
Description
When creating input files with a normal text editor in Linux and then trying to use your tool with those files doesn't work.
The tool exits with the error: Error parsing input file: Unexpected value: [...some garbage].
The problem is that normal text files get encoded with UTF-8 and your tool expects UTF-16LE encoding for the input files.
Solution:
A solution for the above mentioned issue is to simply convert those files to UTF-16LE.
With iconv:
iconv -f UTF-8 -t UTF-16LE input.txt > output.txt
printf '\xFF\xFE' > bom.txt
cat bom.txt output.txt > final_output.txtWith vim:
vim input.txt
:set bomb
:set fileencoding=utf-16le
:wq! output.txt
Note
The Byte Order Mark (BOM) is not needed for the input file to work as setup_var.efi strips it away anyway. However, without it, displaying the input file in the UEFI shell would be a bit ugly.
Expectations:
I don't know if you want to make your tool compatible with other file encodings, but I would somehow expect this to be mentioned in the documentation somewhere. Maybe this will help other people in future facing the same issue. It took me a while to figure out what was causing the problem :D