Skip to content

Change Locale handling to use static methods toLanguageTag() and forLanguageTag #1982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cowtowncoder opened this issue Mar 24, 2018 · 4 comments
Labels
3.x Issues to be only tackled for Jackson 3.x, not 2.x

Comments

@cowtowncoder
Copy link
Member

(note: follow up for #1948)

It seems that static methods of Locale:

  • toLanguageTag() (for serialization)
  • forLanguageTag(String) (for deserialization)

would work better than existing logic, so let's see if we can use those.

Since this is potentially breaking change, regarding backwards compatibility, it can not go in a patch version (2.9.x), but needs to go in 3.0.

@cowtowncoder cowtowncoder added 3.x Issues to be only tackled for Jackson 3.x, not 2.x ACTIVE labels Mar 24, 2018
@cowtowncoder
Copy link
Member Author

Hmmh. Ok, trouble.

On plus side, serialization already uses toLanguageTag(): no change needed.

On downside, forLanguageTag() does NOT accept underscore at all, it seems, just hyphen.
So it is not really an improvement.

Not sure if there is anything to do... back to the old drawing board.

@cowtowncoder
Copy link
Member Author

Have to shelve for now.

@takeseem
Copy link

takeseem commented Apr 21, 2018

I hope you can support, because of our app and server are use Java's System and use Jackson json protocol.

at last, we can use -Dsystem.properties to switch back to des Locale like in Jackson v2.7.6.

@cowtowncoder
Copy link
Member Author

@takeseem I don't think this can be done, at all. I do not know of any way to make it work in backwards compatible way, or how change even should work.

If you need such handling I would recommend use of custom serializer and/or deserializer for Locale type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues to be only tackled for Jackson 3.x, not 2.x
Projects
None yet
Development

No branches or pull requests

2 participants