[SPIGOT-7676] Issues with locale-specific string conversions (e.g. toLowercase()) Created: 31/May/24 Updated: 25/Dec/24 Resolved: 02/Jun/24 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | blablubbabc | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | item, locale, serialization | ||
| Version: | This server is running CraftBukkit version dev-Spigot-864e4ac-c8b4da8 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
We are using the locale-specific `toLowercase()` in a few places in both Bukkit and CraftBukkit. This can result in unexpected results for certain locales, such as turkish (tr-TR), which handles lowercase for the `I` character a bit differently. For example, in 1.20.4, the config deserialization of any item enchantments containing an `I` in their name was broken (I noticed it for the `PIERCING` enchantment). Log.severe("Piercing enchantment name lowercase: " + Enchantment.PIERCING.getName().toLowerCase()); Log.severe("Piercing enchantment found?: " + Enchantment.getByName(Enchantment.PIERCING.getName())) yields Piercing enchantment name lowercase: pıercıng Piercing enchantment found?: null This no longer the case in 1.20.6 due to deserialization changes, but similar issues might likely still affect us in a few other places currently. For example:
TODO: Still need to check for and test more examples in which this might currently still be an issue. |
| Comments |
| Comment by md_5 [ 01/Jun/24 ] |
|
At some point this was fixed across the codebase, but I guess new ones have slipped in |