| ... | @@ -2088,7 +2088,7 @@ pub fn nanoSecondsToFileTime(ns: Io.Timestamp) FILETIME { | ... | @@ -2088,7 +2088,7 @@ pub fn nanoSecondsToFileTime(ns: Io.Timestamp) FILETIME { |
| 2088 | /// Compares two WTF16 strings using the equivalent functionality of | 2088 | /// Compares two WTF16 strings using the equivalent functionality of |
| 2089 | /// `RtlEqualUnicodeString` (with case insensitive comparison enabled). | 2089 | /// `RtlEqualUnicodeString` (with case insensitive comparison enabled). |
| 2090 | /// This function can be called on any target. | 2090 | /// This function can be called on any target. |
| 2091 | pub fn eqlIgnoreCaseWTF16(a: []const u16, b: []const u16) bool { | 2091 | pub fn eqlIgnoreCaseWtf16(a: []const u16, b: []const u16) bool { |
| 2092 | if (@inComptime() or builtin.os.tag != .windows) { | 2092 | if (@inComptime() or builtin.os.tag != .windows) { |
| 2093 | // This function compares the strings code unit by code unit (aka u16-to-u16), | 2093 | // This function compares the strings code unit by code unit (aka u16-to-u16), |
| 2094 | // so any length difference implies inequality. In other words, there's no possible | 2094 | // so any length difference implies inequality. In other words, there's no possible |
| ... | @@ -2165,19 +2165,19 @@ pub fn eqlIgnoreCaseWtf8(a: []const u8, b: []const u8) bool { | ... | @@ -2165,19 +2165,19 @@ pub fn eqlIgnoreCaseWtf8(a: []const u8, b: []const u8) bool { |
| 2165 | | 2165 | |
| 2166 | fn testEqlIgnoreCase(comptime expect_eql: bool, comptime a: []const u8, comptime b: []const u8) !void { | 2166 | fn testEqlIgnoreCase(comptime expect_eql: bool, comptime a: []const u8, comptime b: []const u8) !void { |
| 2167 | try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWtf8(a, b)); | 2167 | try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWtf8(a, b)); |
| 2168 | try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWTF16( | 2168 | try std.testing.expectEqual(expect_eql, eqlIgnoreCaseWtf16( |
| 2169 | std.unicode.utf8ToUtf16LeStringLiteral(a), | 2169 | std.unicode.utf8ToUtf16LeStringLiteral(a), |
| 2170 | std.unicode.utf8ToUtf16LeStringLiteral(b), | 2170 | std.unicode.utf8ToUtf16LeStringLiteral(b), |
| 2171 | )); | 2171 | )); |
| 2172 | | 2172 | |
| 2173 | try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWtf8(a, b)); | 2173 | try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWtf8(a, b)); |
| 2174 | try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWTF16( | 2174 | try comptime std.testing.expect(expect_eql == eqlIgnoreCaseWtf16( |
| 2175 | std.unicode.utf8ToUtf16LeStringLiteral(a), | 2175 | std.unicode.utf8ToUtf16LeStringLiteral(a), |
| 2176 | std.unicode.utf8ToUtf16LeStringLiteral(b), | 2176 | std.unicode.utf8ToUtf16LeStringLiteral(b), |
| 2177 | )); | 2177 | )); |
| 2178 | } | 2178 | } |
| 2179 | | 2179 | |
| 2180 | test "eqlIgnoreCaseWTF16/Wtf8" { | 2180 | test "eqlIgnoreCaseWtf16/Wtf8" { |
| 2181 | try testEqlIgnoreCase(true, "\x01 a B Λ ɐ", "\x01 A b λ Ɐ"); | 2181 | try testEqlIgnoreCase(true, "\x01 a B Λ ɐ", "\x01 A b λ Ɐ"); |
| 2182 | // does not do case-insensitive comparison for codepoints >= U+10000 | 2182 | // does not do case-insensitive comparison for codepoints >= U+10000 |
| 2183 | try testEqlIgnoreCase(false, "𐓏", "𐓷"); | 2183 | try testEqlIgnoreCase(false, "𐓏", "𐓷"); |