liblcf icon indicating copy to clipboard operation
liblcf copied to clipboard

XML Writer can generate non-utf8 valid xmls

Open Ghabry opened this issue 10 years ago • 4 comments

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.

Ghabry avatar Sep 13 '15 20:09 Ghabry

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.

fdelapena avatar Dec 18 '15 14:12 fdelapena

Related: #251

fdelapena avatar Oct 25 '18 00:10 fdelapena

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?

SmiVan avatar Mar 17 '20 18:03 SmiVan

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.

Ghabry avatar Mar 17 '20 19:03 Ghabry