Skip to content

Commit

Permalink
Update Unicodejsps to U13.0 and E13.1; a few fixes also for UTS unico…
Browse files Browse the repository at this point in the history
…de-org#18. Note that the easiest way to support U13 and E13.1 was to copy some extra files into idna/13.1 and security/13.1
  • Loading branch information
macchiati committed Feb 26, 2021
1 parent a2290a9 commit 088593b
Show file tree
Hide file tree
Showing 24 changed files with 45,166 additions and 16 deletions.
2 changes: 1 addition & 1 deletion UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeJsp.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public static String getIdentifier(String script) {

static final String VERSIONS = "Version 3.9; "
+ "ICU version: " + VersionInfo.ICU_VERSION.getVersionString(2, 2) + "; "
+ "Unicode version: " + UCharacter.getUnicodeVersion().getVersionString(2, 2) + "; "
+ "Unicode/Emoji version: " + UCharacter.getUnicodeVersion().getVersionString(2, 2) + "; "
+ (CachedProps.IS_BETA ? "Unicodeβ version: " + CachedProps.CACHED_PROPS.version.getVersionString(2, 2) + "; " : "");

public static String getVersions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ public int getMaxWidth(boolean getShortest) {
return maxFirstValueAliasWidth;
return maxValueWidth;
}

public final UnicodeSet getBoolean() {
return getSet("Yes", null);
}

public final UnicodeSet getSet(String propertyValue) {
return getSet(propertyValue, null);
Expand Down
18 changes: 10 additions & 8 deletions UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,7 @@ public static void showSet(UnicodeSet inputSetRaw, CodePointShower codePointShow
out.append("</td></tr>");
}
} else if (codePointShower.abbreviate) {
if (codePointShower.doTable) {
out.append("<tr><td colSpan='4'>");
}
codePointShower.showAbbreviated(inputSetRaw, out);
if (codePointShower.doTable) {
out.append("</td></tr>");
}
} else {
LinkedHashMap<String,UnicodeSet> items = new LinkedHashMap<String, UnicodeSet>();
String specials = "Unassigned, Private use, or Surrogates";
Expand Down Expand Up @@ -392,7 +386,7 @@ public static void showSet(UnicodeSet inputSetRaw, CodePointShower codePointShow
for (String newBlock : items.keySet()) {
UnicodeSet set = items.get(newBlock);
if (codePointShower.doTable) {
out.append("<tr><td colSpan='4'>");
out.append("<tr><td colSpan='3'>");
}
out.append("<h3>" + newBlock + "</b> <div class='ri'>items: " + numberFormat.format(set.size()) + "</div></h3>\n");
if (codePointShower.doTable) {
Expand Down Expand Up @@ -627,10 +621,15 @@ List<UnicodeProperty> getProps(String input) {
private void showAbbreviated(UnicodeSet a, Appendable out) throws IOException {
UnicodeUtilities.CodePointShower codePointShower = this;

boolean haveStrings = false;
for (UnicodeSetIterator it = new UnicodeSetIterator(a); it.nextRange();) {
int s = it.codepoint;
if (s == UnicodeSetIterator.IS_STRING) {
out.append(UnicodeUtilities.showCodePoint(it.string)).append("<br>\n");
if (!haveStrings && codePointShower.doTable) {
out.append("<tr><td colSpan='3'>");
haveStrings = true;
}
out.append(UnicodeUtilities.showCodePoint(it.string)).append("\n");
} else {
int end = it.codepointEnd;
if (end == s) {
Expand All @@ -655,6 +654,9 @@ private void showAbbreviated(UnicodeSet a, Appendable out) throws IOException {
}
}
}
if (haveStrings && codePointShower.doTable) {
out.append("</td></tr>");
}
}

String getPropString(List<UnicodeProperty> props, String codePoints, boolean shortName) {
Expand Down
13 changes: 8 additions & 5 deletions UnicodeJsps/src/main/java/org/unicode/jsp/XPropertyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,21 @@ public String transform(Integer source) {
for (String prop : cp.getAvailable()) {
add2(cp.getProperty(prop));
}
UnicodeSet Basic_Emoji = cp.getProperty("Basic_Emoji").getSet("Yes");
UnicodeSet RGI_Emoji_Modifier_Sequence = cp.getProperty("RGI_Emoji_Modifier_Sequence").getSet("Yes");
UnicodeSet RGI_Emoji_Tag_Sequence = cp.getProperty("RGI_Emoji_Tag_Sequence").getSet("Yes");
UnicodeSet RGI_Emoji_Zwj_Sequence = cp.getProperty("RGI_Emoji_Zwj_Sequence").getSet("Yes");
UnicodeSet Basic_Emoji = cp.getProperty("Basic_Emoji").getBoolean();
UnicodeSet Emoji_Keycap_Sequence = cp.getProperty("RGI_Emoji_Keycap_Sequence").getBoolean();
UnicodeSet RGI_Emoji_Modifier_Sequence = cp.getProperty("RGI_Emoji_Modifier_Sequence").getBoolean();
UnicodeSet RGI_Emoji_Tag_Sequence = cp.getProperty("RGI_Emoji_Tag_Sequence").getBoolean();
UnicodeSet RGI_Emoji_Flag_Sequence = cp.getProperty("RGI_Emoji_Flag_Sequence").getBoolean();
UnicodeSet RGI_Emoji_Zwj_Sequence = cp.getProperty("RGI_Emoji_Zwj_Sequence").getBoolean();
UnicodeSet RGI_Emoji = new UnicodeSet()
.add(Basic_Emoji)
.add(Emoji_Keycap_Sequence)
.add(RGI_Emoji_Modifier_Sequence)
.add(RGI_Emoji_Flag_Sequence)
.add(RGI_Emoji_Tag_Sequence)
.add(RGI_Emoji_Zwj_Sequence)
.freeze();
add(new UnicodeSetProperty().set(RGI_Emoji).setMain("RGI_Emoji", "RGI_Emoji", UnicodeProperty.BINARY, "13.0"));

}

private void addCollationProperty() {
Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 088593b

Please sign in to comment.