Skip to content
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

Fix issues if runing in an environment with a Turkish locale #652

Merged
merged 2 commits into from Aug 8, 2015

Conversation

schlan
Copy link

@schlan schlan commented Jun 9, 2015

Description

When using LOWER_CASE_WITH_DASHES or LOWER_CASE_WITH_UNDERSCORES as FieldNamingPolicy it could happen that certain fields won't get serialized/deserialized.
I've seen that behavior on devices with a turkish (tr-TR) locale. toLowerCase() uses the device's locale and converts an I into an ı. (JavaDoc)

Example

A field with the name:

...
int lowerId = 8;
....

will turn into:

{ ... 'lower-ıd':8 ... }

Recreation steps

Check out the first commit (299ee89) and run the test with the following JVM flags: -Duser.language=tr -Duser.region=TR

References

https://code.google.com/p/google-gson/issues/detail?id=541
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toLowerCase()

Sebastian Chlan added 2 commits June 9, 2015 15:12
Run the FieldNamingTest with the JVM options: `-Duser.language=tr
-Duser.region=TR`
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@inder123
Copy link
Collaborator

inder123 commented Aug 8, 2015

👍
Thanks for the fix.

inder123 added a commit that referenced this pull request Aug 8, 2015
Fix issues if runing in an environment with a Turkish locale
@inder123 inder123 merged commit 0a93efa into google:master Aug 8, 2015
@inder123 inder123 self-assigned this Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants