When passing source code containing a string with a UTF-8 encoded character, such as the FULL BLOCK (0xE2 0x96 0x88), Python attempts to open the file using the operating system's default encoding, which might be CP1250 or another random code page. In such cases, file reading fails due to encoding mismatches.
There should be either an option to specify the Lua source code encoding explicitly, or the file should be open with encoding='utf-8', errors='ignore' and the output XML written with encoding='utf-8'.
When passing source code containing a string with a UTF-8 encoded character, such as the FULL BLOCK (0xE2 0x96 0x88), Python attempts to open the file using the operating system's default encoding, which might be CP1250 or another random code page. In such cases, file reading fails due to encoding mismatches.
There should be either an option to specify the Lua source code encoding explicitly, or the file should be open with
encoding='utf-8', errors='ignore'
and the output XML written withencoding='utf-8'
.