diff options
author | Tor Norbye <tnorbye@google.com> | 2012-01-06 09:29:25 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-01-06 09:29:25 -0800 |
commit | 18bce12c5916331971b2e8108f8485cc56b696d3 (patch) | |
tree | 2c634dc2e09bf68bfe21faa0674c208e62017c71 /ide_common/src/com/android/ide/common | |
parent | 9f338c0725644f84597366c1e4acb680a72b3f00 (diff) | |
download | sdk-18bce12c5916331971b2e8108f8485cc56b696d3.zip sdk-18bce12c5916331971b2e8108f8485cc56b696d3.tar.gz sdk-18bce12c5916331971b2e8108f8485cc56b696d3.tar.bz2 |
Fix locale handling of uppercase/lowercase
This changeset fixes issue
23747: i and İ character problem in turkish operating Systems...
and probably many other bugs in the Turkish locale.
Basically, we had a lot of String.toLowerCase() and
String.toUpperCase() calls. This performs locale sensitive
conversions, which in many cases is NOT what we want; for "machine
readable" conversions we should be using Locale.US which performs no
special cases.
For more, see
http://developer.android.com/reference/java/util/Locale.html#default_locale
Change-Id: I996b0e70fb377e8dae484c5811deb8bc9afb684c
Diffstat (limited to 'ide_common/src/com/android/ide/common')
-rw-r--r-- | ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java | 3 | ||||
-rw-r--r-- | ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java index ff18bdc..972a50f 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java @@ -16,6 +16,7 @@ package com.android.ide.common.resources.configuration; +import java.util.Locale; import java.util.regex.Pattern; /** @@ -51,7 +52,7 @@ public final class LanguageQualifier extends ResourceQualifier { * @param value the value of the qualifier, as returned by {@link #getValue()}. */ public static String getFolderSegment(String value) { - String segment = value.toLowerCase(); + String segment = value.toLowerCase(Locale.US); if (sLanguagePattern.matcher(segment).matches()) { return segment; } diff --git a/ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java b/ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java index 7e8ca9a..2b9c29e 100644 --- a/ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java +++ b/ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java @@ -16,6 +16,7 @@ package com.android.ide.common.resources.configuration; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -54,7 +55,8 @@ public final class RegionQualifier extends ResourceQualifier { */ public static String getFolderSegment(String value) { if (value != null) { - String segment = "r" + value.toUpperCase(); //$NON-NLS-1$ + // See http://developer.android.com/reference/java/util/Locale.html#default_locale + String segment = "r" + value.toUpperCase(Locale.US); //$NON-NLS-1$ if (sRegionPattern.matcher(segment).matches()) { return segment; } |