The issue was that `event.utf8_buf` is not null-terminated. In debug builds, it's explicitly filled with `0xff` which let to the garbage characters. Now check for the size of the first valid utf8 char and only copy that. Thanks to PratikPB2123 for the investigation in #112719.