X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbits%2FStringUtils.java;h=fffce206875cf663480d2041aac121f88b58d01a;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=26d90a400577bf663f0b4550d1429de628c68b01;hpb=218d18dbda14a7bf482d6c07bed66f16bcd6a6ba;p=fanfix.git diff --git a/src/jexer/bits/StringUtils.java b/src/jexer/bits/StringUtils.java index 26d90a4..fffce20 100644 --- a/src/jexer/bits/StringUtils.java +++ b/src/jexer/bits/StringUtils.java @@ -450,7 +450,7 @@ public class StringUtils { || ((ch >= 0x20000) && (ch <= 0x2fffd)) || ((ch >= 0x30000) && (ch <= 0x3fffd)) // emoji - || ((ch >= 0x1f004) && (ch <= 0x1f9c0)) + || ((ch >= 0x1f004) && (ch <= 0x1fffd)) ) ) { return 2; @@ -475,4 +475,24 @@ public class StringUtils { return n; } + /** + * Check if character is in the CJK range. + * + * @param ch character to check + * @return true if this character is in the CJK range + */ + public static boolean isCjk(final int ch) { + return ((ch >= 0x2e80) && (ch <= 0x9fff)); + } + + /** + * Check if character is in the emoji range. + * + * @param ch character to check + * @return true if this character is in the emoji range + */ + public static boolean isEmoji(final int ch) { + return ((ch >= 0x1f004) && (ch <= 0x1fffd)); + } + }