就像标题所说的那样.我想知道给定的java String是否包含表情符号.
我无法使用,Character.UnicodeBlock.of(char) == Character.UnicodeBlock.EMOTICONS
因为这需要API级别19.
我发现这个代码适用于iOS,但它并不适用,因为它看起来像java和objective-c以不同的方式处理代理对.
我看过的文件告诉我:
A char value, therefore, represents Basic Multilingual Plane (BMP) code points, including the surrogate code points, or code units of the UTF-16 encoding
我不太清楚这意味着什么.这仅仅意味着他们还将BMP点作为他们的第一个数字吗?
根据维基百科,表情符号集位于0x1f600和0x1f64f之间,但我不知道如何检查char是否在该范围内.
我曾希望这样的东西可行,但事实并非如此
if (0x1f600 <= a && a <= 0x1f64f) { Print.d("Unicode", "groovy!"); }
那么我该怎么做呢?