aboutsummaryrefslogtreecommitdiffstats
path: root/ide_common/src/com
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-01-06 09:29:25 -0800
committerTor Norbye <tnorbye@google.com>2012-01-06 09:29:25 -0800
commit18bce12c5916331971b2e8108f8485cc56b696d3 (patch)
tree2c634dc2e09bf68bfe21faa0674c208e62017c71 /ide_common/src/com
parent9f338c0725644f84597366c1e4acb680a72b3f00 (diff)
downloadsdk-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')
-rw-r--r--ide_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java3
-rw-r--r--ide_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java4
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;
}