/*
*******************************************************************************
- * Copyright (C) 2009-2013, Google, International Business Machines Corporation and *
- * others. All Rights Reserved. *
+ * Copyright (C) 2009-2014, Google, International Business Machines Corporation and
+ * others. All Rights Reserved.
*******************************************************************************
*/
package com.ibm.icu.dev.test.translit;
import com.ibm.icu.text.UTF16;
import com.ibm.icu.text.UnicodeSet;
import com.ibm.icu.text.UnicodeSetIterator;
+import com.ibm.icu.util.ULocale;
/**
* @author markdavis
) {
continue;
}
-
- String scriptName = UScript.getName(script);
+
+ String scriptName = UScript.getName(script); // long name
+ ULocale locale = new ULocale(scriptName);
+ if (locale.getLanguage().equals("new") || locale.getLanguage().equals("pau")) {
+ if (logKnownIssue("11171",
+ "long script name loosely looks like a locale ID with a known likely script")) {
+ continue;
+ }
+ }
Transliterator t;
try {
t = Transliterator.getInstance("any-" + scriptName);
if (t != null) {
t.transform(test); // just verify we don't crash
}
- scriptName = UScript.getShortName(script);
- t = Transliterator.getInstance("any-" + scriptName);
+ String shortScriptName = UScript.getShortName(script); // 4-letter script code
+ try {
+ t = Transliterator.getInstance("any-" + shortScriptName);
+ } catch (Exception e) {
+ errln("Transliterator.getInstance() worked for \"any-" + scriptName +
+ "\" but not for \"any-" + shortScriptName + '\"');
+ }
t.transform(test); // just verify we don't crash
}
}
-
+
/**
* Check to make sure that wide characters are converted when going to narrow scripts.
*/