mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
Support using WTF::StringImpl from Zig (#3279)
* Fix `make headers` * [JS parser] Fix bug with printing non-ascii import paths in ascii mode * Introduce `bun.String` * Add test for non-ascii imports & entry points * Add comment * Fix build issue * Support HTTP server * Make it print the same --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -1467,6 +1467,17 @@ pub fn toUTF8ListWithType(list_: std.ArrayList(u8), comptime Type: type, utf16:
|
||||
return toUTF8ListWithTypeBun(list_, Type, utf16);
|
||||
}
|
||||
|
||||
pub fn toUTF8FromLatin1(allocator: std.mem.Allocator, latin1: []const u8) !?std.ArrayList(u8) {
|
||||
if (bun.JSC.is_bindgen)
|
||||
unreachable;
|
||||
|
||||
if (isAllASCII(latin1))
|
||||
return null;
|
||||
|
||||
var list = try std.ArrayList(u8).initCapacity(allocator, latin1.len);
|
||||
return try allocateLatin1IntoUTF8WithList(list, 0, []const u8, latin1);
|
||||
}
|
||||
|
||||
pub fn toUTF8ListWithTypeBun(list_: std.ArrayList(u8), comptime Type: type, utf16: Type) !std.ArrayList(u8) {
|
||||
var list = list_;
|
||||
var utf16_remaining = utf16;
|
||||
|
||||
Reference in New Issue
Block a user