Skip to content

Emscripten: index.json handling broken for Turkish locale #2786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ghabry opened this issue May 18, 2022 · 2 comments · Fixed by EasyRPG/liblcf#442
Closed

Emscripten: index.json handling broken for Turkish locale #2786

Ghabry opened this issue May 18, 2022 · 2 comments · Fixed by EasyRPG/liblcf#442
Labels
Emscripten WebAssembly/JavaScript port for web browsers Patch available
Milestone

Comments

@Ghabry
Copy link
Member

Ghabry commented May 18, 2022

I'm not fully sure how this happens yet but I guess Emscripten passes in the locale of the browser as the C locale because the normalization happens in ICU.

When running the web player in a browser that has a turkish locale set then "I" will be lowercased to "ı" instead of "i". (Unicode is fun)

This makes the lookup in index.json fail because this is the wrong "i".


Not tested in non-web players yet. There this goes likely unnoticed because when everything is lowercased to "ı" it will just work.


Guess this could be solved by passing a specific locale to icu::UnicodeString uni = icu::UnicodeString(str.data(), str.length(), "utf-8").toLower(); in liblcf (making this a liblcf bug that only matters on the Player side)

@Ghabry Ghabry added the Emscripten WebAssembly/JavaScript port for web browsers label May 18, 2022
@Ghabry Ghabry added this to the 0.7.1 milestone May 18, 2022
@carstene1ns
Copy link
Member

I remember we needed this in gencache as well:
https://github.com/EasyRPG/Tools/blob/master/gencache/src/main.cpp#L79

@Ghabry
Copy link
Member Author

Ghabry commented May 20, 2022

indeed gencache has the same bug and this is great for testing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emscripten WebAssembly/JavaScript port for web browsers Patch available
Development

Successfully merging a pull request may close this issue.

2 participants