Fixing for emoji families
This commit is contained in:
@@ -41,7 +41,8 @@ fun String.firstFullChar(): String {
|
|||||||
start = next
|
start = next
|
||||||
} else {
|
} else {
|
||||||
// If join, searches for the next char
|
// If join, searches for the next char
|
||||||
if (codePoint == 0x200D) {
|
if (codePoint == 0xFE0F) {
|
||||||
|
} else if (codePoint == 0x200D) {
|
||||||
isInJoin = true
|
isInJoin = true
|
||||||
} else {
|
} else {
|
||||||
// stops when two chars are not joined together
|
// stops when two chars are not joined together
|
||||||
|
|||||||
@@ -49,4 +49,9 @@ class CharsetTest {
|
|||||||
fun testTeacher() {
|
fun testTeacher() {
|
||||||
Assert.assertEquals("\uD83E\uDDD1\uD83C\uDFFF\u200D\uD83C\uDFEB", "\uD83E\uDDD1\uD83C\uDFFF\u200D\uD83C\uDFEBasdf".firstFullChar())
|
Assert.assertEquals("\uD83E\uDDD1\uD83C\uDFFF\u200D\uD83C\uDFEB", "\uD83E\uDDD1\uD83C\uDFFF\u200D\uD83C\uDFEBasdf".firstFullChar())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testVariation() {
|
||||||
|
Assert.assertEquals("\uD83D\uDC68\u200D\u2764\uFE0F\u200D\uD83D\uDC8B\u200D\uD83D\uDC68", "\uD83D\uDC68\u200D\u2764\uFE0F\u200D\uD83D\uDC8B\u200D\uD83D\uDC68ddd".firstFullChar())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user