| ... | @@ -1939,3 +1939,18 @@ test "ComponentIterator roots" { | ... | @@ -1939,3 +1939,18 @@ test "ComponentIterator roots" { |
| 1939 | try std.testing.expectEqualStrings("//a/b//", it.root().?); | 1939 | try std.testing.expectEqualStrings("//a/b//", it.root().?); |
| 1940 | } | 1940 | } |
| 1941 | } | 1941 | } |
| | 1942 | |
| | 1943 | /// Format a path encoded as bytes for display as UTF-8. |
| | 1944 | /// Returns a Formatter for the given path. The path will be converted to valid UTF-8 |
| | 1945 | /// during formatting. This is a lossy conversion if the path contains any ill-formed UTF-8. |
| | 1946 | /// Ill-formed UTF-8 byte sequences are replaced by the replacement character (U+FFFD) |
| | 1947 | /// according to "U+FFFD Substitution of Maximal Subparts" from Chapter 3 of |
| | 1948 | /// the Unicode standard, and as specified by https://encoding.spec.whatwg.org/#utf-8-decoder |
| | 1949 | pub const fmtAsUtf8Lossy = std.unicode.fmtUtf8; |
| | 1950 | |
| | 1951 | /// Format a path encoded as WTF-16 LE for display as UTF-8. |
| | 1952 | /// Return a Formatter for a (potentially ill-formed) UTF-16 LE path. |
| | 1953 | /// The path will be converted to valid UTF-8 during formatting. This is |
| | 1954 | /// a lossy conversion if the path contains any unpaired surrogates. |
| | 1955 | /// Unpaired surrogates are replaced by the replacement character (U+FFFD). |
| | 1956 | pub const fmtWtf16LeAsUtf8Lossy = std.unicode.fmtUtf16Le; |