Skip to content

Commit

Permalink
dev name and script🐈
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jan 18, 2024
1 parent ff1a2d9 commit 8007355
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -1355,23 +1355,42 @@ public static void getDifferences(
// ((RuleBasedCollator) col).setNumericCollation(true);
// }

private static String getScriptCat(String versionPrefix, int cp) {
String scriptCat = getFactory().getProperty(versionPrefix + "script").getValue(cp).replace("_", " ");
if (scriptCat.equals("Common") || scriptCat.equals("Inherited")) {
scriptCat = getFactory().getProperty(versionPrefix + "gc").getValue(cp).replace("_", " ");
} else {
scriptCat += " Script";
}
return scriptCat;
}

public static void showProperties(
int cp, String history, boolean showDevProperties, Appendable out) throws IOException {
String text = UTF16.valueOf(cp);

String name = getFactory().getProperty("Name").getValue(cp);
if (name != null) {
name = toHTML.transliterate(name);
final String devName =
showDevProperties ? getFactory().getProperty("Udev:Name").getValue(cp) : null;
if (name == null) {
if (devName != null) {
name = "<span class='changed'>" + toHTML.transliterate(devName) + "</span>";
} else {
name = "<i>Unknown</i>";
}
} else {
name = "<i>Unknown</i>";
name = toHTML.transliterate(name);
}
boolean allowed = XIDModifications.isAllowed(cp);

String scriptCat = getFactory().getProperty("script").getValue(cp).replace("_", " ");
if (scriptCat.equals("Common") || scriptCat.equals("Inherited")) {
scriptCat = getFactory().getProperty("gc").getValue(cp).replace("_", " ");
} else {
scriptCat += " Script";
String scriptCat = getScriptCat("", cp);
if (showDevProperties) {
String devScriptCat = getScriptCat("Udev:", cp);
if (!devScriptCat.equals(scriptCat)) {
// The old and new script and GC will be given below; only show the new one here,
// but highlighted.
scriptCat = "<span class='changed'>" + devScriptCat + "</span>";
}
}

String hex = com.ibm.icu.impl.Utility.hex(cp, 4);
Expand Down

0 comments on commit 8007355

Please sign in to comment.