Fix toKStringFromUtf32 (#3903)
Remove null terminator from returned String
This commit is contained in:
@@ -532,8 +532,8 @@ public fun CPointer<IntVar>.toKStringFromUtf32(): String {
|
|||||||
var toIndex = 0
|
var toIndex = 0
|
||||||
while (true) {
|
while (true) {
|
||||||
val value = nativeBytes[fromIndex++]
|
val value = nativeBytes[fromIndex++]
|
||||||
toIndex++
|
|
||||||
if (value == 0) break
|
if (value == 0) break
|
||||||
|
toIndex++
|
||||||
if (value >= 0x10000 && value <= 0x10ffff) {
|
if (value >= 0x10000 && value <= 0x10ffff) {
|
||||||
toIndex++
|
toIndex++
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user