Closed fishcu closed 6 months ago
As another data point, FireRed behaves in the same fashion.
Interestingly, the wrong character mapping is the same, i.e., é => [nothing] and ' => â.
It appears that Android replaces special characters in the source code with escape sequences. Tentatively I have hardcoded those escape sequences in the characters tables. This could potentially affect more special characters though.
After doing more research it seems that é gets replaced with the bytes C3 A9
when compiling on Windows. This makes no sense considering the character byte is E9
in both UTF-8 and Windows-1252.
Similarly the apostrophe character 2019
is replaced with E2 20AC 2122
which at least makes more sense considering it's multiple bytes. It turns out that E2
is â which is why that shows up.
To fix this I set the encoding option to be UTF-8 in the Gradle build script. The unicode escape decoding might be completely unnecessary. Although strangely enough it still appears to give the correct results even with the incorrect escapes which is even more confusing.
When randomizing a HGSS ROM, the resulting ROM will have special characters replaced by the wrong characters, for example the "é" in "Pokémon", or the " ' " in "you'll".
I have done the patching with the latest released version v0.3.3 and with a clean HG ROM on an Android 12 device.
I have attached two screenshots that show the issue.