-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
i - I case conversion problem in Turkish locale #953
Comments
Thank you for reporting this. There are indeed a few places where leading character(s) are being lower cased, in addition to the code that tries full lower-casing you mention. I'll see if I can figure out a way to tease the problem, although I assume it would require use of the specific letter(s) to have effect, as well as override of the default locale. I wonder, however, if the turkish handling would be desired in some cases? Since context objects ( |
I love it. The first bug I've seen in a while that successfully calls out the famous "Turkish I Problem": http://www.salon.com/2004/12/09/spolsky/ |
@cbsmith :-) -- thank you for sharing that, hadn't seen it. |
@cowtowncoder |
@Dimezis I have no active plan -- not aware of efficient way of doing this. So PR (or even to existing impl for other libraries) would be welcome. |
… fix turkish i parsing FasterXML#953 (comment)
@cowtowncoder please check out the PR and let me know what you think #2554 |
I added a failing test (slight modification from one in patch), and will see if it'd be easier to address that particular part (case-insensitive properties not matching), first, without worrying about naming strategy part. |
Ok, so: I fixed the first part, wherein case-insensitive deserialization should work with Turkish locale too (I have some work for 3.0.0/master to finish) up, and will file another for remaining work that is needed for |
In Turkish language there are two kind of i letter and therefore there is a common issue when trying to convert to lower or upper case (check: http://lotusnotus.com/lotusnotus_en.nsf/dx/dotless-i-tolowercase-and-touppercase-functions-use-responsibly.htm).
When a JSON string which contains field starting with upper case i (e.g. Icon) is being tried to deserialize with caseInsensitive = true property, the mapper is unable to find and fill the "icon" field in the object model because of the convertion issue described above.
Technical info: I've checked the source code of the library and there are some places where toLowerCase and/or toUpperCase is called with default Locale. These calls should be done with English locale when the calls are key-related to avoid this kind of issues.
Here is the specific place for the actual issue: https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/deser/impl/BeanPropertyMap.java#L314
Workaround: JsonProperty annotation have to be set for these fields to exactly set the name case-sensitively.
The text was updated successfully, but these errors were encountered: