manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Furkan KAMACI (JIRA)" <>
Subject [jira] [Commented] (CONNECTORS-1304) ban usage of String.toUpperCase() without Locale
Date Sun, 14 Aug 2016 12:28:20 GMT


Furkan KAMACI commented on CONNECTORS-1304:

You can pass a locale to String.toLowerCase(), so the naive approach would be to tell Java,
that we are in the US or using the English language: String.toLowerCase(Locale.US) or String.toLowerCase(Locale.ENGLISH).
This produces identical results but is still not consistent. What happens if the US government
decides to lowercase/uppercase like in Turkey? -- OK, don’t use Locale.US (this is also
too US-centric). Locale.ENGLISH is fine and very generic, but languages also change over the
years (who knows?), but we want to have it language invariant! If you are using Java 6, there
is a much better constant: Locale.ROOT -- You should use this constant for our lowercase example:

You can get more info from here:

By the way do I need a write right for this page:

> ban usage of String.toUpperCase() without Locale
> ------------------------------------------------
>                 Key: CONNECTORS-1304
>                 URL:
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: SearchBlox connector
>    Affects Versions: ManifoldCF 2.4
>            Reporter: Ahmet Arslan
>            Assignee: Ahmet Arslan
>             Fix For: ManifoldCF 2.5
> When relied on the default Locale, toUpperCase() is not reliable. For example: In,
"title_boost".toUpperCase() will yield {{TİTLE_BOOST}} on Turkish Locale and won't match
{{TITLE_BOOST}}. We should prevent this in a more permanent way. I would like to integrate
Uwe's [forbidden apis|] when I have time.

This message was sent by Atlassian JIRA

View raw message