Umar Ata
10/06/2021, 7:15 PMephemient
10/06/2021, 7:39 PMephemient
10/06/2021, 7:48 PMephemient
10/06/2021, 7:49 PMUmar Ata
10/06/2021, 7:51 PMephemient
10/06/2021, 7:56 PMephemient
10/06/2021, 7:57 PMUmar Ata
10/06/2021, 7:59 PMUmar Ata
10/06/2021, 7:59 PMephemient
10/06/2021, 8:08 PMUmar Ata
10/06/2021, 8:22 PMUmar Ata
10/06/2021, 8:24 PMprivate fun containsEmoji(displayName: String): Boolean {
val nameLength = displayName.length
for (i in 0 until nameLength) {
val hs = displayName[i]
if (hs.code in 0xd800..0xdbff) {
val ls = displayName[i + 1]
val uc = (hs.code - 0xd800) * 0x400 + (ls.code - 0xdc00) + 0x10000
if (uc in 0x1d000..0x1f77f) {
return true
}
} else if (Character.isHighSurrogate(hs)) {
val ls = displayName[i + 1]
if (ls.code == 0x20e3) {
return true
}
} else {
// non surrogate
if (hs.code in 0x2100..0x27ff) {
return true
} else if (hs.code in 0x2B05..0x2b07) {
return true
} else if (hs.code in 0x2934..0x2935) {
return true
} else if (hs.code in 0x3297..0x3299) {
return true
} else if (hs.code == 0xa9 || hs.code == 0xae || hs.code == 0x303d || hs.code == 0x3030 ||
hs.code == 0x2b55 || hs.code == 0x2b1c || hs.code == 0x2b1b || hs.code == 0x2b50
) {
return true
}
}
}
return false
}
ephemient
10/06/2021, 8:25 PM