Skip to content

Fury does not preserve script/extensions following serialise/deserialise #3966

Description

@pferraro

Search before asking

  • 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.

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions