Fix copying UTF-16 -> UTF-8 sometimes causing invalid UTF-8 bytes (#20601)

This commit is contained in:
Zack Radisic
2025-06-24 19:46:29 -07:00
committed by GitHub
parent 90e3d6c898
commit 61024b2b4a
16 changed files with 99 additions and 21 deletions

View File

@@ -379,7 +379,6 @@ pub const BufferedWriter = struct {
this.remain()[0 .. bytes.len * 2],
[]const u16,
bytes,
true,
);
this.context.list.items.len += @as(usize, decoded.written);
return pending.len;
@@ -393,7 +392,6 @@ pub const BufferedWriter = struct {
this.remain()[0 .. bytes.len * 2],
[]const u16,
bytes,
true,
);
this.pos += @as(usize, decoded.written);
}