import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
+import java.util.Locale;
import com.ibm.icu.charset.UConverterSharedData.UConverterType;
import com.ibm.icu.impl.ICUData;
}
}
- if (icuCanonicalName.toLowerCase().indexOf("gb18030") >= 0) {
+ String lowerCaseName = icuCanonicalName.toLowerCase(Locale.ENGLISH);
+ if (lowerCaseName.indexOf("gb18030") >= 0) {
/* set a flag for GB 18030 mode, which changes the callback behavior */
this.options |= MBCS_OPTION_GB18030;
- } else if (icuCanonicalName.toLowerCase().indexOf("keis") >= 0) {
+ } else if (lowerCaseName.indexOf("keis") >= 0) {
this.options |= MBCS_OPTION_KEIS;
- } else if (icuCanonicalName.toLowerCase().indexOf("jef") >= 0) {
+ } else if (lowerCaseName.indexOf("jef") >= 0) {
this.options |= MBCS_OPTION_JEF;
- } else if (icuCanonicalName.toLowerCase().indexOf("jips") >= 0) {
+ } else if (lowerCaseName.indexOf("jips") >= 0) {
this.options |= MBCS_OPTION_JIPS;
}
/**
*******************************************************************************
-* Copyright (C) 1996-2010, International Business Machines Corporation and *
+* Copyright (C) 1996-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Locale;
import java.util.MissingResourceException;
import com.ibm.icu.lang.UCharacter;
}
// try extended names first
- int result = getExtendedChar(name.toLowerCase(), choice);
+ int result = getExtendedChar(name.toLowerCase(Locale.ENGLISH), choice);
if (result >= -1) {
return result;
}
- String upperCaseName = name.toUpperCase();
+ String upperCaseName = name.toUpperCase(Locale.ENGLISH);
// try algorithmic names first, if fails then try group names
// int result = getAlgorithmChar(choice, uppercasename);
m_utilStringBuffer_.append('<');
m_utilStringBuffer_.append(result);
m_utilStringBuffer_.append('-');
- String chStr = Integer.toHexString(ch).toUpperCase();
+ String chStr = Integer.toHexString(ch).toUpperCase(Locale.ENGLISH);
int zeros = 4 - chStr.length();
while (zeros > 0) {
m_utilStringBuffer_.append('0');
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Locale;
import java.util.regex.Pattern;
import com.ibm.icu.lang.UCharacter;
if (negative) {
i = -i;
}
- String result = Long.toString(i, 16).toUpperCase();
+ String result = Long.toString(i, 16).toUpperCase(Locale.ENGLISH);
if (result.length() < places) {
result = "0000000000000000".substring(result.length(),places) + result;
}
}
if (region != null) {
- region = region.toUpperCase(Locale.US);
+ region = region.toUpperCase(Locale.ENGLISH);
}
// Filter by region/rawOffset
*/
static boolean parseCustomID(String id, int[] fields) {
NumberFormat numberFormat = null;
- String idUppercase = id.toUpperCase();
+ String idUppercase = id.toUpperCase(Locale.ENGLISH);
if (id != null && id.length() > kGMT_ID.length() &&
idUppercase.startsWith(kGMT_ID)) {
private static SoftReference<Map<String, UnicodeBlock>> mref;
private static String trimBlockName(String name) {
- String upper = name.toUpperCase();
+ String upper = name.toUpperCase(Locale.ENGLISH);
StringBuilder result = new StringBuilder(upper.length());
for (int i = 0; i < upper.length(); i++) {
char c = upper.charAt(i);
private static int getCalendarTypeForLocale(ULocale l) {
String s = CalendarUtil.getCalendarType(l);
if (s != null) {
- s = s.toLowerCase();
+ s = s.toLowerCase(Locale.ENGLISH);
for (int i = 0; i < calTypes.length; ++i) {
if (s.equals(calTypes[i])) {
return i;
throw new IllegalArgumentException(
"The input currency code is not 3-letter alphabetic code.");
}
- return new Currency(theISOCode.toUpperCase(Locale.US));
+ return new Currency(theISOCode.toUpperCase(Locale.ENGLISH));
}
private static boolean isAlpha3Code(String code) {
/*
**********************************************************************
-* Copyright (c) 2001-2010, International Business Machines
+* Copyright (c) 2001-2011, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
} else {
tag.append("Transliterate");
}
- tag.append(specToFind.get().toUpperCase());
+ tag.append(specToFind.get().toUpperCase(Locale.ENGLISH));
try {
// The Transliterate*_xxx resource is an array of