/**
*******************************************************************************
-* Copyright (C) 2005-2010, International Business Machines Corporation and *
+* Copyright (C) 2005-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
return sb.toString();
} else {
- result = new String(fRawInput, getName());
+ String name = getName();
+ /*
+ * getName() may return a name with a suffix 'rtl' or 'ltr'. This cannot
+ * be used to open a charset (e.g. IBM424_rtl). The ending '_rtl' or 'ltr'
+ * should be stripped off before creating the string.
+ */
+ int startSuffix = name.indexOf("_rtl") < 0 ? name.indexOf("_ltr") : name.indexOf("_rtl");
+ if (startSuffix > 0) {
+ name = name.substring(0, startSuffix);
+ }
+ result = new String(fRawInput, name);
}
return result;
charsetMatch = m.getName();
CheckAssert(charsetMatch.equals("IBM424_rtl"));
CheckAssert(m.getLanguage().equals("he"));
+ try {
+ m.getString();
+ } catch (Exception ex) {
+ errln("Error getting string for charsetMatch: " + charsetMatch);
+ }
m = _testIBM424_he_ltr(s);
charsetMatch = m.getName();
CheckAssert(charsetMatch.equals("IBM424_ltr"));
CheckAssert(m.getLanguage().equals("he"));
+ try {
+ m.getString();
+ } catch (Exception ex) {
+ errln("Error getting string for charsetMatch: " + charsetMatch);
+ }
}
private CharsetMatch _test1255(String s) throws Exception {