You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fury does not preserve script/extensions following serialise/deserialise #3966
I had searched in the issues and found no similar issues.
Version
Fury only serialises the language/country/variant fields of a Locale, ignoring any script/extensions, resulting in an inconsistent values following deserialisation.
Component(s)
Java
Minimal reproduce step
On my machine:
Fory fory = Fory.builder().withLanguage(Language.JAVA).build();
for (Locale locale : Locale.getAvailableLocales()) {
Locale deserialised = fory.deserialize(fory.serialize(locale));
assertEquals(locale, deserialised); // This fails for locales that define a script or extensions
}
What did you expect to see?
Assertions should pass.
What did you see instead?
The assertion fails for any locale that defines a script or extensions.
The issue that i found is in 'LocaleSerializer.java'
private static final Map<Tuple3<String, String, String>, Locale> LOCALE_CACHE = new HashMap<>(createCacheMap());
only serializes 3 fields, ignoring scripts & extensions. LOCALE_CACHE also uses a 'Tuple3' so it can't distinguish Locales differing in scripts and extensions.
I'm working on a solution to extend the serialization to include those 2 fields.
Activity
FireStorm8142 commentedon Aug 26, 2026
The issue that i found is in 'LocaleSerializer.java'
private static final Map<Tuple3<String, String, String>, Locale> LOCALE_CACHE = new HashMap<>(createCacheMap());only serializes 3 fields, ignoring scripts & extensions.
LOCALE_CACHEalso uses a 'Tuple3' so it can't distinguish Locales differing in scripts and extensions.I'm working on a solution to extend the serialization to include those 2 fields.
dhruv9b commentedon Sep 17, 2026
@FireStorm8142 Are you still working on this issue?
fix(java): preserve script and extensions in LocaleSerializer (apache…