As the name says. I want to find out if a given java line contains an emoticon.
I can not use Character.UnicodeBlock.of(char) == Character.UnicodeBlock.EMOTICONS, because it requires API level 19.
I found this code for iOS , but it is not applicable, since it looks like java and objective-c handles surrogate pairs in different ways.
The docs I looked through tell me that:
A char value, therefore, represents Basic Multilingual Plane (BMP) code points, including the surrogate code points, or code units of the UTF-16 encoding
I'm not quite sure what that means. Does this mean that they also include the BMP as the first number?
According to Wikipedia, a set of emotions lies between 0x1f600 and 0x1f64f, but I don’t know how to check if char is in this range.
I was hoping something like this would work, but it doesn’t
if (0x1f600 <= a && a <= 0x1f64f)
{
Print.d("Unicode", "groovy!");
}
So how do I do this?