EasyRPG / liblcf

Library to handle RPG Maker 2000/2003 and EasyRPG projects
https://easyrpg.org
MIT License
113 stars 52 forks source link

(lcf2xml) Converting from .edb to .ldb wipes most of the database, shows not well-formed (invalid token) error #443

Closed lumiscosity closed 2 years ago

lumiscosity commented 2 years ago

While converting an .ldb file to an .edb file works without issues, converting back seems to cause problems. Namely, after throwing out ~100 not well-formed (invalid token) errors, the file comes out significantly smaller. When converted back into an .edb file, it reveals that only the Actors and Skills tab as well as Battle Commands have been saved properly, while every other one has been wiped. After looking up the issue, it seems to be related to incorrect XML syntax - however, at first glance, nothing seems to be wrong in the file, and running it through validators online doesn't seem to pick up any errors.

Curiously, this doesn't happen with .lmt/.emt or .lmu/.emu files.

To replicate this error, simply create a new RPG Maker 2000/2003 project (the error happens on both versions), convert the resulting .ldb to .edb, and then back to .ldb.

Here's an example that contains both a normal .edb file and the corrupted one. This is based on the default new project 2003 .ldb. rpg-rt-edb.zip

Ghabry commented 2 years ago

The tool lacks autodetection.

You must specify the encoding in RPG_RT.ini:

[EasyRPG]
Encoding=1252

1252 for western europe, 932 for japanese. see https://wiki.easyrpg.org/user/player/special-features

Note that the default LDB database created by the editor can still contain japanese strings. So even for this one it is recommended to use 932.

lumiscosity commented 2 years ago

Thank you, this has fixed the issue!