Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UnicodeJsps/src/main/java/org/unicode/jsp/CachedProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import com.ibm.icu.util.ICUUncheckedIOException;
import com.ibm.icu.util.VersionInfo;

import org.unicode.props.UnicodeProperty;

public class CachedProps {
public static final boolean IS_BETA = false;

Expand Down
101 changes: 0 additions & 101 deletions UnicodeJsps/src/main/java/org/unicode/jsp/CharEncoder.java

This file was deleted.

207 changes: 0 additions & 207 deletions UnicodeJsps/src/main/java/org/unicode/jsp/FileUtilities.java

This file was deleted.

28 changes: 14 additions & 14 deletions UnicodeJsps/src/main/java/org/unicode/jsp/LanguageCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.ibm.icu.text.Collator;
import com.ibm.icu.util.ULocale;

public class LanguageCode {
public class LanguageCode {

static public final Pattern languageID = Pattern.compile(
" (?: ( [a-z A-Z]{2,8} | [a-z A-Z]{2,3} [-_] [a-z A-Z]{3} )"
Expand All @@ -32,12 +32,12 @@ public class LanguageCode {
.split("\\s+")));

enum Subtag {
language,
script,
region,
language,
script,
region,
variants,
extensions,
privateUse,
extensions,
privateUse,
privateUse2;
String get(Matcher m) {
return m.group(ordinal()+1);
Expand Down Expand Up @@ -88,8 +88,8 @@ private static void validate(String input, ULocale ulocale, StringBuilder builde
posAfter = input.length();
}
prefix = "<p><i><b>Ill-Formed Language Identifier: </b></i>" + input.substring(0, posBefore)
+ "<span class='x'>" + input.substring(posBefore, i)
+ "×"
+ "<span class='x'>" + input.substring(posBefore, i)
+ "×"
+ input.substring(i, posAfter)
+ "</span>" + input.substring(posAfter, input.length())
+ "<br><i>Couldn't parse past the point marked with <span class='x'>×</span>.</i></p>\n";
Expand Down Expand Up @@ -130,7 +130,7 @@ private static void validate(String input, ULocale ulocale, StringBuilder builde
}
fixed = fixCodes.get(languageCode);
} else { // must be 2
// cases are the following. For the replacement, we use fix(extlang) if valid, otherwise fix(lang) if valid, otherwise fix(extlang)
// cases are the following. For the replacement, we use fix(extlang) if valid, otherwise fix(lang) if valid, otherwise fix(extlang)
// zh-cmn - valid => cmn
// en-cmn - valid => cmn // but shouldn't be; by canonicalization en-cmn = cmn
// eng-cmn - invalid => cmn
Expand Down Expand Up @@ -367,17 +367,17 @@ private static String getIcuName(String code, ULocale ulocale) {
switch(code.length()) {
case 2:
case 3:
icuName = code.compareTo("a") < 0
icuName = code.compareTo("a") < 0
? ULocale.getDisplayCountry("und-" + code, ulocale)
: ULocale.getDisplayLanguage(code, ulocale);
break;
case 4:
case 4:
if (code.compareTo("A") >= 0) {
icuName = ULocale.getDisplayScript("und-" + code, ulocale);
icuName = ULocale.getDisplayScript("und-" + code, ulocale);
break;
} // otherwise fall through!
default:
icuName = ULocale.getDisplayVariant("und-Latn-AQ-" + code, ulocale).toLowerCase();
default:
icuName = ULocale.getDisplayVariant("und-Latn-AQ-" + code, ulocale).toLowerCase();
break;
}
return icuName;
Expand Down
Loading