diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2024-02-03 14:29:54 -0800 |
|---|---|---|
| committer | Ryan Liptak <squeek502@hotmail.com> | 2024-02-24 14:04:59 -0800 |
| commit | 80508b98c26051cec9f96aceabea03df80e72942 (patch) | |
| tree | 10c48a68e41507a1b841b9ed451819ef6637a4ba /src | |
| parent | 4ee1309a8d261360c5b80a9533535231b60780f5 (diff) | |
| download | zig-80508b98c26051cec9f96aceabea03df80e72942.tar.gz zig-80508b98c26051cec9f96aceabea03df80e72942.zip | |
Update deprecated `std.unicode` function usages
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 2 | ||||
| -rw-r--r-- | src/windows_sdk.zig | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index 584a34eeee..db739ebce7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5756,7 +5756,7 @@ fn readSourceFileToEndAlloc( // If the file starts with a UTF-16 little endian BOM, translate it to UTF-8 if (mem.startsWith(u8, source_code, "\xff\xfe")) { const source_code_utf16_le = mem.bytesAsSlice(u16, source_code); - const source_code_utf8 = std.unicode.utf16leToUtf8AllocZ(allocator, source_code_utf16_le) catch |err| switch (err) { + const source_code_utf8 = std.unicode.utf16LeToUtf8AllocZ(allocator, source_code_utf16_le) catch |err| switch (err) { error.DanglingSurrogateHalf => error.UnsupportedEncoding, error.ExpectedSecondSurrogateHalf => error.UnsupportedEncoding, error.UnexpectedSecondSurrogateHalf => error.UnsupportedEncoding, diff --git a/src/windows_sdk.zig b/src/windows_sdk.zig index 5a3d4c2945..1330565648 100644 --- a/src/windows_sdk.zig +++ b/src/windows_sdk.zig @@ -133,7 +133,7 @@ const RegistryUtf8 = struct { const value_utf16le = try registry_utf16le.getString(allocator, subkey_utf16le, value_name_utf16le); defer allocator.free(value_utf16le); - const value_utf8: []u8 = std.unicode.utf16leToUtf8Alloc(allocator, value_utf16le) catch |err| switch (err) { + const value_utf8: []u8 = std.unicode.utf16LeToUtf8Alloc(allocator, value_utf16le) catch |err| switch (err) { error.OutOfMemory => return error.OutOfMemory, else => return error.StringNotFound, }; |
