EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
965 stars 183 forks source link

Save scene: Japanese glyphs used for HP and LV fail to render #3102

Open Ghabry opened 9 months ago

Ghabry commented 9 months ago

Reported here: https://twitter.com/Xraniuviprpg/status/1707065300225781782

I think the issue is this code:

auto lvl_short = ToString(lcf::Data::terms.lvl_short);
if (lvl_short.size() != 2) {
    lvl_short.resize(2, ' ');
}

The idea is here to check for two glyphs but this is incorrect for everything that is not ASCII. E.g. a Japanese glyph takes up at least 3 bytes and corrupting it. Same should happen for two extended latin glyphs, e.g. ää. They take up 2 bytes each so it will be truncated to ä.

Needs an alternative approach to properly position the text.