liblcf
liblcf copied to clipboard
XML Writer can generate non-utf8 valid xmls
When the encoding is not correctly specified the strings written by liblcf are not valid utf8 codepoints and converting this back to binary generates a parse error (malformed token) in expat and this breaks the files.
It looks like strings should be saved as UTF-8 but they are being saved raw, without any encoding conversion. IMO, encoding detection code should be moved from player to liblcf to deal with this from both Player and lcf2xml.
Related: #251
Using lcf2xml on Yume2kki (which uses the Japanese encoding) produces a lot of malformed strings, and I suspect this is the cause.
What would need to be done in order to fix this?
The proper solution would be using escape sequences instead of writing binary.
But the solution for your problem is: You have to put
[EasyRPG]
Encoding=932
in RPG_RT.ini because the tools use a very naive encoding detection.