how do i insert an unicode character literal, valu...
# announcements
l
how do i insert an unicode character literal, value of which is more than
0xffff
?
\U12345678
doesn't seem to work
d
Kotlin uses UTF-16, so you'll have to covert to two UTF-16 surrogate chars, as far as I know.
l
aha. this seems to do the job:
val Int.u get() = String(Character.toChars(this))
. not sure why literals are not allowed
also jvm's regex seems to be understanding these correctly