MinecraftForge icon indicating copy to clipboard operation
MinecraftForge copied to clipboard

Locales with non-arabic numerals cause crashes

Open Nik-mmzd opened this issue 11 months ago • 10 comments

Minecraft Version: 1.20.1

Forge Version: 47.4.0

Logs: https://gist.github.com/Nik-mmzd/2477df2a2a1060b043ac191ad48d5081

Steps to Reproduce:

  1. Set any Regional format with non-arabic numerals
  2. Forge will crash on early window. Disable it in config
  3. Mods (e.g. Quark) trying to load resources with numerals will crash with net.minecraft.ResourceLocationException

Description of issue: I'm just describing the issue, I'm not the one who got this crash

User came to me with the following issue: Forge was acting weird. The problem was solved by changing Region Settings in Windows to English, and seems to be caused by non-"default" numerals used by user locale:

[10Apr2025 23:21:48.573] [Worker-Main-9/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: net.minecraft.ResourceLocationException: Non [a-z0-9/._-] character in path of location: quark:textures/model/entity/variants/cow\u0661.png

quark:textures/model/entity/variants/cow\u0661.png is actually quark:textures/model/entity/variants/cow1.png, but with Arabic-Indic Digit One.

Also, for some reason Early Loading Window was not working at all with Arabic regional settings, but started when it was changed to English.

Nik-mmzd avatar Apr 11 '25 15:04 Nik-mmzd

Ya this doesn't seem to be a bug in Forge itself. As its an issue with vanilla/java encoding of String.format. Best bet is to have Quark fix it by using the Local variant of String.format

If there is an issue on Forge's end for the early lading screen, feel free to report that log. But this is on Quarks end. There isnt a way for us to decode local issues like this on the MC Code side.

LexManos avatar Apr 11 '25 16:04 LexManos

First crash log in Gist is actually for Early Loading Screen, and it somehow seemed to be resolved by changing locale to English. I'll ask user for more feedback if possible or will try to reproduce the issue myself

Update: I just got confirmation from the user that Early Loading Screen crashes with Arabic locale, but works fine with English one, with the same setup (the only difference is locale)

Nik-mmzd avatar Apr 11 '25 16:04 Nik-mmzd

Oh interesting, I must of skipped over that log file. Anyways it seems to be erroring on this line

Would have to look into how to get unlocalized version info from lwjgl

LexManos avatar Apr 11 '25 19:04 LexManos

What particular locale does this happen with?

basdxz avatar Apr 12 '25 00:04 basdxz

Arabic (Egypt), for example.

Image

Nik-mmzd avatar Apr 12 '25 00:04 Nik-mmzd

Related to https://github.com/LWJGL/lwjgl3/issues/779 then, upstream LWJGL3 bug.

The fix: https://github.com/LWJGL/lwjgl3/commit/40f18a7f98f322fce8a7fb6c3aaf49b9b6cf818b#diff-2397f45c6e4ee297fc4d54fdad3f2b76ec211e4483a5573ab3cc946ba8e9e1e1

Was included in the LWJGL3 stable release 3.3.2

basdxz avatar Apr 13 '25 06:04 basdxz

As a workaround for pre-LWJGL-3.3.2-versions Forge can auto-disable Early Window automatically for specific locales... Or patch LWJGL 🤷

Nik-mmzd avatar Apr 13 '25 11:04 Nik-mmzd

The workaround would be to disable the early loading window in your FML config. It might be possible to do a local check, though @basdxz would have to check that.

Jonathing avatar Apr 13 '25 11:04 Jonathing

As a workaround for pre-LWJGL-3.3.2-versions Forge can auto-disable Early Window automatically for specific locales... Or patch LWJGL 🤷

Does disabling it fix the issue?

basdxz avatar Apr 13 '25 14:04 basdxz

Does disabling it fix the issue?

Yes, Forge is able to load when Early Window is disabled (look at mods count for locale proof): Image

Nik-mmzd avatar Apr 13 '25 15:04 Nik-mmzd