From aa17f97d13c1b82261396daeb97ef9799d112060 Mon Sep 17 00:00:00 2001 From: Dylan Conway Date: Tue, 6 Dec 2022 21:04:38 -0800 Subject: [PATCH] fix failing text decoder test --- src/string_immutable.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/string_immutable.zig b/src/string_immutable.zig index 38b11a5d56..2967869ff9 100644 --- a/src/string_immutable.zig +++ b/src/string_immutable.zig @@ -980,8 +980,7 @@ pub fn toUTF16Alloc(allocator: std.mem.Allocator, bytes: []const u8, comptime fa const offset = @truncate(u32, validated.count); const trimmed = bun.simdutf.trim.utf8(bytes[offset..]); - if (trimmed.len == 0 and offset == 0) - return &[_]u16{}; + first_non_ascii = offset; if (trimmed.len == 0) break :use_simdutf;