authorgravatar for marko03kostic@protonmail.comusebeforefree <marko03kostic@protonmail.com> 2025-10-10 17:18:34+00:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-10 23:53:00+02:00
log62e3d46287a98e98cbddfb3eb6e966ffc324b280
tree50fe194df306e72877c2c1fbbbdc916ac93b2a70
parent45143c6f04c84e8a519aa24e4d79e9385b5d5e2f

replaced https://simonsapin.github.io/wtf-8/ with https://wtf-8.codeberg.page/


10 files changed, 115 insertions(+), 115 deletions(-)

lib/std/Thread.zig+1-1
......@@ -250,7 +250,7 @@ pub const GetNameError = error{
250250 Unexpected,
251251} || posix.PrctlError || posix.ReadError || std.fs.File.OpenError || std.fmt.BufPrintError;
252252
253/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
253/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
254254/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
255255pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]const u8 {
256256 buffer_ptr[max_name_len] = 0;
lib/std/fs.zig+18-18
......@@ -46,7 +46,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE
4646/// The byte count includes room for a null sentinel byte.
4747///
4848/// * On Windows, `[]u8` file paths are encoded as
49/// [WTF-8](https://simonsapin.github.io/wtf-8/).
49/// [WTF-8](https://wtf-8.codeberg.page/).
5050/// * On WASI, `[]u8` file paths are encoded as valid UTF-8.
5151/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with
5252/// no particular encoding.
......@@ -68,7 +68,7 @@ pub const max_path_bytes = switch (native_os) {
6868/// operations are likely to fit into a `u8` array of this length, but
6969/// (depending on the platform) this assumption may not hold for every configuration.
7070/// The byte count does not include a null sentinel byte.
71/// On Windows, `[]u8` file name components are encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
71/// On Windows, `[]u8` file name components are encoded as [WTF-8](https://wtf-8.codeberg.page/).
7272/// On WASI, file name components are encoded as valid UTF-8.
7373/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.
7474pub const max_name_bytes = switch (native_os) {
......@@ -100,7 +100,7 @@ pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, null);
100100/// Same as `Dir.updateFile`, except asserts that both `source_path` and `dest_path`
101101/// are absolute. See `Dir.updateFile` for a function that operates on both
102102/// absolute and relative paths.
103/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
103/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
104104/// On WASI, both paths should be encoded as valid UTF-8.
105105/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
106106pub fn updateFileAbsolute(
......@@ -117,7 +117,7 @@ pub fn updateFileAbsolute(
117117/// Same as `Dir.copyFile`, except asserts that both `source_path` and `dest_path`
118118/// are absolute. See `Dir.copyFile` for a function that operates on both
119119/// absolute and relative paths.
120/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
120/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
121121/// On WASI, both paths should be encoded as valid UTF-8.
122122/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
123123pub fn copyFileAbsolute(
......@@ -134,7 +134,7 @@ pub fn copyFileAbsolute(
134134/// Create a new directory, based on an absolute path.
135135/// Asserts that the path is absolute. See `Dir.makeDir` for a function that operates
136136/// on both absolute and relative paths.
137/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
137/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
138138/// On WASI, `absolute_path` should be encoded as valid UTF-8.
139139/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
140140pub fn makeDirAbsolute(absolute_path: []const u8) !void {
......@@ -155,7 +155,7 @@ pub fn makeDirAbsoluteW(absolute_path_w: [*:0]const u16) !void {
155155}
156156
157157/// Same as `Dir.deleteDir` except the path is absolute.
158/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
158/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
159159/// On WASI, `dir_path` should be encoded as valid UTF-8.
160160/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
161161pub fn deleteDirAbsolute(dir_path: []const u8) !void {
......@@ -176,7 +176,7 @@ pub fn deleteDirAbsoluteW(dir_path: [*:0]const u16) !void {
176176}
177177
178178/// Same as `Dir.rename` except the paths are absolute.
179/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
179/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
180180/// On WASI, both paths should be encoded as valid UTF-8.
181181/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
182182pub fn renameAbsolute(old_path: []const u8, new_path: []const u8) !void {
......@@ -238,7 +238,7 @@ pub fn defaultWasiCwd() std.os.wasi.fd_t {
238238/// See `openDirAbsoluteZ` for a function that accepts a null-terminated path.
239239///
240240/// Asserts that the path parameter has no null bytes.
241/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
241/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
242242/// On WASI, `absolute_path` should be encoded as valid UTF-8.
243243/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
244244pub fn openDirAbsolute(absolute_path: []const u8, flags: Dir.OpenOptions) File.OpenError!Dir {
......@@ -263,7 +263,7 @@ pub fn openDirAbsoluteW(absolute_path_c: [*:0]const u16, flags: Dir.OpenOptions)
263263/// operates on both absolute and relative paths.
264264/// Asserts that the path parameter has no null bytes. See `openFileAbsoluteZ` for a function
265265/// that accepts a null-terminated path.
266/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
266/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
267267/// On WASI, `absolute_path` should be encoded as valid UTF-8.
268268/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
269269pub fn openFileAbsolute(absolute_path: []const u8, flags: File.OpenFlags) File.OpenError!File {
......@@ -288,7 +288,7 @@ pub fn openFileAbsoluteW(absolute_path_w: []const u16, flags: File.OpenFlags) Fi
288288/// For example, instead of testing if a file exists and then opening it, just
289289/// open it and handle the error for file not found.
290290/// See `accessAbsoluteZ` for a function that accepts a null-terminated path.
291/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
291/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
292292/// On WASI, `absolute_path` should be encoded as valid UTF-8.
293293/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
294294pub fn accessAbsolute(absolute_path: []const u8, flags: File.OpenFlags) Dir.AccessError!void {
......@@ -312,7 +312,7 @@ pub fn accessAbsoluteW(absolute_path: [*:0]const u16, flags: File.OpenFlags) Dir
312312/// operates on both absolute and relative paths.
313313/// Asserts that the path parameter has no null bytes. See `createFileAbsoluteC` for a function
314314/// that accepts a null-terminated path.
315/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
315/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
316316/// On WASI, `absolute_path` should be encoded as valid UTF-8.
317317/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
318318pub fn createFileAbsolute(absolute_path: []const u8, flags: File.CreateFlags) File.OpenError!File {
......@@ -336,7 +336,7 @@ pub fn createFileAbsoluteW(absolute_path_w: [*:0]const u16, flags: File.CreateFl
336336/// Asserts that the path is absolute. See `Dir.deleteFile` for a function that
337337/// operates on both absolute and relative paths.
338338/// Asserts that the path parameter has no null bytes.
339/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
339/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
340340/// On WASI, `absolute_path` should be encoded as valid UTF-8.
341341/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
342342pub fn deleteFileAbsolute(absolute_path: []const u8) Dir.DeleteFileError!void {
......@@ -361,7 +361,7 @@ pub fn deleteFileAbsoluteW(absolute_path_w: [*:0]const u16) Dir.DeleteFileError!
361361/// Asserts that the path is absolute. See `Dir.deleteTree` for a function that
362362/// operates on both absolute and relative paths.
363363/// Asserts that the path parameter has no null bytes.
364/// On Windows, `absolute_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
364/// On Windows, `absolute_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
365365/// On WASI, `absolute_path` should be encoded as valid UTF-8.
366366/// On other platforms, `absolute_path` is an opaque sequence of bytes with no particular encoding.
367367pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {
......@@ -379,7 +379,7 @@ pub fn deleteTreeAbsolute(absolute_path: []const u8) !void {
379379}
380380
381381/// Same as `Dir.readLink`, except it asserts the path is absolute.
382/// On Windows, `pathname` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
382/// On Windows, `pathname` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
383383/// On WASI, `pathname` should be encoded as valid UTF-8.
384384/// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding.
385385pub fn readLinkAbsolute(pathname: []const u8, buffer: *[max_path_bytes]u8) ![]u8 {
......@@ -405,7 +405,7 @@ pub fn readLinkAbsoluteZ(pathname_c: [*:0]const u8, buffer: *[max_path_bytes]u8)
405405/// one; the latter case is known as a dangling link.
406406/// If `sym_link_path` exists, it will not be overwritten.
407407/// See also `symLinkAbsoluteZ` and `symLinkAbsoluteW`.
408/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
408/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
409409/// On WASI, both paths should be encoded as valid UTF-8.
410410/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
411411pub fn symLinkAbsolute(
......@@ -537,7 +537,7 @@ pub fn selfExePathAlloc(allocator: Allocator) ![]u8 {
537537/// This function may return an error if the current executable
538538/// was deleted after spawning.
539539/// Returned value is a slice of out_buffer.
540/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
540/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
541541/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
542542///
543543/// On Linux, depends on procfs being mounted. If the currently executing binary has
......@@ -677,7 +677,7 @@ pub fn selfExeDirPathAlloc(allocator: Allocator) ![]u8 {
677677
678678/// Get the directory path that contains the current executable.
679679/// Returned value is a slice of out_buffer.
680/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
680/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
681681/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
682682pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {
683683 const self_exe_path = try selfExePath(out_buffer);
......@@ -687,7 +687,7 @@ pub fn selfExeDirPath(out_buffer: []u8) SelfExePathError![]const u8 {
687687}
688688
689689/// `realpath`, except caller must free the returned memory.
690/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
690/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
691691/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
692692/// See also `Dir.realpath`.
693693pub fn realpathAlloc(allocator: Allocator, pathname: []const u8) ![]u8 {
lib/std/fs/Dir.zig+32-32
......@@ -855,7 +855,7 @@ pub const OpenError = error{
855855 /// WASI-only; file paths must be valid UTF-8.
856856 InvalidUtf8,
857857 /// Windows-only; file paths provided by the user must be valid WTF-8.
858 /// https://simonsapin.github.io/wtf-8/
858 /// https://wtf-8.codeberg.page/
859859 InvalidWtf8,
860860 BadPathName,
861861 DeviceBusy,
......@@ -873,7 +873,7 @@ pub fn close(self: *Dir) void {
873873/// To create a new file, see `createFile`.
874874/// Call `File.close` to release the resource.
875875/// Asserts that the path parameter has no null bytes.
876/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
876/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
877877/// On WASI, `sub_path` should be encoded as valid UTF-8.
878878/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
879879pub fn openFile(self: Dir, sub_path: []const u8, flags: File.OpenFlags) File.OpenError!File {
......@@ -999,7 +999,7 @@ pub fn openFileZ(self: Dir, sub_path: [*:0]const u8, flags: File.OpenFlags) File
999999}
10001000
10011001/// Same as `openFile` but Windows-only and the path parameter is
1002/// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded.
1002/// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded.
10031003pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File.OpenError!File {
10041004 const w = windows;
10051005 const file: File = .{
......@@ -1038,7 +1038,7 @@ pub fn openFileW(self: Dir, sub_path_w: []const u16, flags: File.OpenFlags) File
10381038/// Creates, opens, or overwrites a file with write access.
10391039/// Call `File.close` on the result when done.
10401040/// Asserts that the path parameter has no null bytes.
1041/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1041/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
10421042/// On WASI, `sub_path` should be encoded as valid UTF-8.
10431043/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
10441044pub fn createFile(self: Dir, sub_path: []const u8, flags: File.CreateFlags) File.OpenError!File {
......@@ -1150,7 +1150,7 @@ pub fn createFileZ(self: Dir, sub_path_c: [*:0]const u8, flags: File.CreateFlags
11501150}
11511151
11521152/// Same as `createFile` but Windows-only and the path parameter is
1153/// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded.
1153/// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded.
11541154pub fn createFileW(self: Dir, sub_path_w: []const u16, flags: File.CreateFlags) File.OpenError!File {
11551155 const w = windows;
11561156 const read_flag = if (flags.read) @as(u32, w.GENERIC_READ) else 0;
......@@ -1195,7 +1195,7 @@ pub const MakeError = posix.MakeDirError;
11951195/// Creates a single directory with a relative or absolute path.
11961196/// To create multiple directories to make an entire path, see `makePath`.
11971197/// To operate on only absolute paths, see `makeDirAbsolute`.
1198/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1198/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
11991199/// On WASI, `sub_path` should be encoded as valid UTF-8.
12001200/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
12011201pub fn makeDir(self: Dir, sub_path: []const u8) MakeError!void {
......@@ -1221,7 +1221,7 @@ pub fn makeDirW(self: Dir, sub_path: [*:0]const u16) MakeError!void {
12211221/// Returns success if the path already exists and is a directory.
12221222/// This function is not atomic, and if it returns an error, the file system may
12231223/// have been modified regardless.
1224/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1224/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
12251225/// On WASI, `sub_path` should be encoded as valid UTF-8.
12261226/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
12271227/// Fails on an empty path with `error.BadPathName` as that is not a path that can be created.
......@@ -1275,7 +1275,7 @@ pub fn makePathStatus(self: Dir, sub_path: []const u8) (MakeError || StatFileErr
12751275/// Opens the dir if the path already exists and is a directory.
12761276/// This function is not atomic, and if it returns an error, the file system may
12771277/// have been modified regardless.
1278/// `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1278/// `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
12791279fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no_follow: bool) (MakeError || OpenError || StatFileError)!Dir {
12801280 const w = windows;
12811281 var it = try fs.path.componentIterator(sub_path);
......@@ -1326,7 +1326,7 @@ fn makeOpenPathAccessMaskW(self: Dir, sub_path: []const u8, access_mask: u32, no
13261326/// This function performs `makePath`, followed by `openDir`.
13271327/// If supported by the OS, this operation is atomic. It is not atomic on
13281328/// all operating systems.
1329/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1329/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
13301330/// On WASI, `sub_path` should be encoded as valid UTF-8.
13311331/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
13321332pub fn makeOpenPath(self: Dir, sub_path: []const u8, open_dir_options: OpenOptions) (MakeError || OpenError || StatFileError)!Dir {
......@@ -1357,9 +1357,9 @@ pub const RealPathError = posix.RealPathError;
13571357/// `pathname` relative to this `Dir`. If `pathname` is absolute, ignores this
13581358/// `Dir` handle and returns the canonicalized absolute pathname of `pathname`
13591359/// argument.
1360/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1360/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
13611361/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
1362/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1362/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
13631363/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
13641364/// This function is not universally supported by all platforms.
13651365/// Currently supported hosts are: Linux, macOS, and Windows.
......@@ -1429,7 +1429,7 @@ pub fn realpathZ(self: Dir, pathname: [*:0]const u8, out_buffer: []u8) RealPathE
14291429/// Deprecated: use `realpathW2`.
14301430///
14311431/// Windows-only. Same as `Dir.realpath` except `pathname` is WTF16 LE encoded.
1432/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1432/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
14331433/// See also `Dir.realpath`, `realpathW`.
14341434pub fn realpathW(self: Dir, pathname: []const u16, out_buffer: []u8) RealPathError![]u8 {
14351435 var wide_buf: [std.os.windows.PATH_MAX_WIDE]u16 = undefined;
......@@ -1529,7 +1529,7 @@ pub const OpenOptions = struct {
15291529/// open until `close` is called on the result.
15301530/// The directory cannot be iterated unless the `iterate` option is set to `true`.
15311531///
1532/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1532/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
15331533/// On WASI, `sub_path` should be encoded as valid UTF-8.
15341534/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
15351535/// Asserts that the path parameter has no null bytes.
......@@ -1744,7 +1744,7 @@ fn makeOpenDirAccessMaskW(self: Dir, sub_path_w: [*:0]const u16, access_mask: u3
17441744pub const DeleteFileError = posix.UnlinkError;
17451745
17461746/// Delete a file name and possibly the file it refers to, based on an open directory handle.
1747/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1747/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
17481748/// On WASI, `sub_path` should be encoded as valid UTF-8.
17491749/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
17501750/// Asserts that the path parameter has no null bytes.
......@@ -1805,7 +1805,7 @@ pub const DeleteDirError = error{
18051805 /// WASI-only; file paths must be valid UTF-8.
18061806 InvalidUtf8,
18071807 /// Windows-only; file paths provided by the user must be valid WTF-8.
1808 /// https://simonsapin.github.io/wtf-8/
1808 /// https://wtf-8.codeberg.page/
18091809 InvalidWtf8,
18101810 BadPathName,
18111811 /// On Windows, `\\server` or `\\server\share` was not found.
......@@ -1816,7 +1816,7 @@ pub const DeleteDirError = error{
18161816
18171817/// Returns `error.DirNotEmpty` if the directory is not empty.
18181818/// To delete a directory recursively, see `deleteTree`.
1819/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1819/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
18201820/// On WASI, `sub_path` should be encoded as valid UTF-8.
18211821/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
18221822/// Asserts that the path parameter has no null bytes.
......@@ -1858,7 +1858,7 @@ pub const RenameError = posix.RenameError;
18581858/// If new_sub_path already exists, it will be replaced.
18591859/// Renaming a file over an existing directory or a directory
18601860/// over an existing file will fail with `error.IsDir` or `error.NotDir`
1861/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1861/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
18621862/// On WASI, both paths should be encoded as valid UTF-8.
18631863/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
18641864pub fn rename(self: Dir, old_sub_path: []const u8, new_sub_path: []const u8) RenameError!void {
......@@ -1889,7 +1889,7 @@ pub const SymLinkFlags = struct {
18891889/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
18901890/// one; the latter case is known as a dangling link.
18911891/// If `sym_link_path` exists, it will not be overwritten.
1892/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1892/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
18931893/// On WASI, both paths should be encoded as valid UTF-8.
18941894/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
18951895pub fn symLink(
......@@ -1972,7 +1972,7 @@ pub fn symLinkW(
19721972/// Same as `symLink`, except tries to create the symbolic link until it
19731973/// succeeds or encounters an error other than `error.PathAlreadyExists`.
19741974///
1975/// * On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1975/// * On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
19761976/// * On WASI, both paths should be encoded as valid UTF-8.
19771977/// * On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
19781978pub fn atomicSymLink(
......@@ -2018,7 +2018,7 @@ pub const ReadLinkError = posix.ReadLinkError;
20182018/// Read value of a symbolic link.
20192019/// The return value is a slice of `buffer`, from index `0`.
20202020/// Asserts that the path parameter has no null bytes.
2021/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2021/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
20222022/// On WASI, `sub_path` should be encoded as valid UTF-8.
20232023/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
20242024pub fn readLink(self: Dir, sub_path: []const u8, buffer: []u8) ReadLinkError![]u8 {
......@@ -2058,7 +2058,7 @@ pub fn readLinkW(self: Dir, sub_path_w: []const u16, buffer: []u8) ![]u8 {
20582058/// the situation is ambiguous. It could either mean that the entire file was read, and
20592059/// it exactly fits the buffer, or it could mean the buffer was not big enough for the
20602060/// entire file.
2061/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2061/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
20622062/// On WASI, `file_path` should be encoded as valid UTF-8.
20632063/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
20642064pub fn readFile(self: Dir, file_path: []const u8, buffer: []u8) ![]u8 {
......@@ -2085,7 +2085,7 @@ pub const ReadFileAllocError = File.OpenError || File.ReadError || Allocator.Err
20852085/// `File.Reader` which handles this seamlessly.
20862086pub fn readFileAlloc(
20872087 dir: Dir,
2088 /// On Windows, should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2088 /// On Windows, should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
20892089 /// On WASI, should be encoded as valid UTF-8.
20902090 /// On other platforms, an opaque sequence of bytes with no particular encoding.
20912091 sub_path: []const u8,
......@@ -2104,7 +2104,7 @@ pub fn readFileAlloc(
21042104/// `File.Reader`.
21052105pub fn readFileAllocOptions(
21062106 dir: Dir,
2107 /// On Windows, should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2107 /// On Windows, should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
21082108 /// On WASI, should be encoded as valid UTF-8.
21092109 /// On other platforms, an opaque sequence of bytes with no particular encoding.
21102110 sub_path: []const u8,
......@@ -2148,7 +2148,7 @@ pub const DeleteTreeError = error{
21482148 InvalidUtf8,
21492149
21502150 /// Windows-only; file paths provided by the user must be valid WTF-8.
2151 /// https://simonsapin.github.io/wtf-8/
2151 /// https://wtf-8.codeberg.page/
21522152 InvalidWtf8,
21532153
21542154 /// On Windows, file paths cannot contain these characters:
......@@ -2163,7 +2163,7 @@ pub const DeleteTreeError = error{
21632163/// removes it. If it cannot be removed because it is a non-empty directory,
21642164/// this function recursively removes its entries and then tries again.
21652165/// This operation is not atomic on most file systems.
2166/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2166/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
21672167/// On WASI, `sub_path` should be encoded as valid UTF-8.
21682168/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
21692169pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {
......@@ -2370,7 +2370,7 @@ pub fn deleteTree(self: Dir, sub_path: []const u8) DeleteTreeError!void {
23702370
23712371/// Like `deleteTree`, but only keeps one `Iterator` active at a time to minimize the function's stack size.
23722372/// This is slower than `deleteTree` but uses less stack space.
2373/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2373/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
23742374/// On WASI, `sub_path` should be encoded as valid UTF-8.
23752375/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
23762376pub fn deleteTreeMinStackSize(self: Dir, sub_path: []const u8) DeleteTreeError!void {
......@@ -2568,7 +2568,7 @@ fn deleteTreeOpenInitialSubpath(self: Dir, sub_path: []const u8, kind_hint: File
25682568pub const WriteFileError = File.WriteError || File.OpenError;
25692569
25702570pub const WriteFileOptions = struct {
2571 /// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2571 /// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
25722572 /// On WASI, `sub_path` should be encoded as valid UTF-8.
25732573 /// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
25742574 sub_path: []const u8,
......@@ -2586,7 +2586,7 @@ pub fn writeFile(self: Dir, options: WriteFileOptions) WriteFileError!void {
25862586pub const AccessError = posix.AccessError;
25872587
25882588/// Test accessing `sub_path`.
2589/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2589/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
25902590/// On WASI, `sub_path` should be encoded as valid UTF-8.
25912591/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
25922592/// Be careful of Time-Of-Check-Time-Of-Use race conditions when using this function.
......@@ -2641,7 +2641,7 @@ pub const PrevStatus = enum {
26412641/// atime, and mode of the source file so that the next call to `updateFile` will not need a copy.
26422642/// Returns the previous status of the file before updating.
26432643/// If any of the directories do not exist for dest_path, they are created.
2644/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2644/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
26452645/// On WASI, both paths should be encoded as valid UTF-8.
26462646/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
26472647pub fn updateFile(
......@@ -2713,7 +2713,7 @@ pub const CopyFileError = File.OpenError || File.StatError ||
27132713/// dest_path.
27142714///
27152715/// On Windows, both paths should be encoded as
2716/// [WTF-8](https://simonsapin.github.io/wtf-8/). On WASI, both paths should be
2716/// [WTF-8](https://wtf-8.codeberg.page/). On WASI, both paths should be
27172717/// encoded as valid UTF-8. On other platforms, both paths are an opaque
27182718/// sequence of bytes with no particular encoding.
27192719pub fn copyFile(
......@@ -2758,7 +2758,7 @@ pub const AtomicFileOptions = struct {
27582758/// Always call `AtomicFile.deinit` to clean up, regardless of whether
27592759/// `AtomicFile.finish` succeeded. `dest_path` must remain valid until
27602760/// `AtomicFile.deinit` is called.
2761/// On Windows, `dest_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2761/// On Windows, `dest_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
27622762/// On WASI, `dest_path` should be encoded as valid UTF-8.
27632763/// On other platforms, `dest_path` is an opaque sequence of bytes with no particular encoding.
27642764pub fn atomicFile(self: Dir, dest_path: []const u8, options: AtomicFileOptions) !AtomicFile {
......@@ -2792,7 +2792,7 @@ pub const StatFileError = File.OpenError || File.StatError || posix.FStatAtError
27922792/// Symlinks are followed.
27932793///
27942794/// `sub_path` may be absolute, in which case `self` is ignored.
2795/// On Windows, `sub_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2795/// On Windows, `sub_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
27962796/// On WASI, `sub_path` should be encoded as valid UTF-8.
27972797/// On other platforms, `sub_path` is an opaque sequence of bytes with no particular encoding.
27982798pub fn statFile(self: Dir, sub_path: []const u8) StatFileError!Stat {
lib/std/fs/File.zig+1-1
......@@ -60,7 +60,7 @@ pub const OpenError = error{
6060 /// WASI-only; file paths must be valid UTF-8.
6161 InvalidUtf8,
6262 /// Windows-only; file paths provided by the user must be valid WTF-8.
63 /// https://simonsapin.github.io/wtf-8/
63 /// https://wtf-8.codeberg.page/
6464 InvalidWtf8,
6565 /// On Windows, file paths cannot contain these characters:
6666 /// '/', '*', '?', '"', '<', '>', '|'
lib/std/fs/path.zig+1-1
......@@ -2,7 +2,7 @@
22//!
33//! Windows paths are arbitrary sequences of `u16` (WTF-16).
44//! For cross-platform APIs that deal with sequences of `u8`, Windows
5//! paths are encoded by Zig as [WTF-8](https://simonsapin.github.io/wtf-8/).
5//! paths are encoded by Zig as [WTF-8](https://wtf-8.codeberg.page/).
66//! WTF-8 is a superset of UTF-8 that allows encoding surrogate codepoints,
77//! which enables lossless roundtripping when converting to/from WTF-16
88//! (as long as the WTF-8 encoded surrogate codepoints do not form a pair).
lib/std/os.zig+1-1
......@@ -98,7 +98,7 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool {
9898/// For example, while it generally works on Linux, macOS, FreeBSD or Windows, it is
9999/// unsupported on WASI.
100100///
101/// * On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
101/// * On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
102102/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.
103103///
104104/// Calling this function is usually a bug.
lib/std/os/windows.zig+4-4
......@@ -749,7 +749,7 @@ pub const GetCurrentDirectoryError = error{
749749};
750750
751751/// The result is a slice of `buffer`, indexed from 0.
752/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
752/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
753753pub fn GetCurrentDirectory(buffer: []u8) GetCurrentDirectoryError![]u8 {
754754 var wtf16le_buf: [PATH_MAX_WIDE:0]u16 = undefined;
755755 const result = kernel32.GetCurrentDirectoryW(wtf16le_buf.len + 1, &wtf16le_buf);
......@@ -976,7 +976,7 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin
976976}
977977
978978/// Asserts that there is enough space is `out_buffer`.
979/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
979/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
980980fn parseReadlinkPath(path: []const u16, is_relative: bool, out_buffer: []u8) []u8 {
981981 const win32_namespace_path = path: {
982982 if (is_relative) break :path path;
......@@ -2416,13 +2416,13 @@ pub const Wtf8ToPrefixedFileWError = error{InvalidWtf8} || Wtf16ToPrefixedFileWE
24162416
24172417/// Same as `sliceToPrefixedFileW` but accepts a pointer
24182418/// to a null-terminated WTF-8 encoded path.
2419/// https://simonsapin.github.io/wtf-8/
2419/// https://wtf-8.codeberg.page/
24202420pub fn cStrToPrefixedFileW(dir: ?HANDLE, s: [*:0]const u8) Wtf8ToPrefixedFileWError!PathSpace {
24212421 return sliceToPrefixedFileW(dir, mem.sliceTo(s, 0));
24222422}
24232423
24242424/// Same as `wToPrefixedFileW` but accepts a WTF-8 encoded path.
2425/// https://simonsapin.github.io/wtf-8/
2425/// https://wtf-8.codeberg.page/
24262426pub fn sliceToPrefixedFileW(dir: ?HANDLE, path: []const u8) Wtf8ToPrefixedFileWError!PathSpace {
24272427 var temp_path: PathSpace = undefined;
24282428 temp_path.len = try std.unicode.wtf8ToWtf16Le(&temp_path.data, path);
lib/std/posix.zig+39-39
......@@ -1624,7 +1624,7 @@ pub const OpenError = error{
16241624 InvalidUtf8,
16251625
16261626 /// Windows-only; file paths provided by the user must be valid WTF-8.
1627 /// https://simonsapin.github.io/wtf-8/
1627 /// https://wtf-8.codeberg.page/
16281628 InvalidWtf8,
16291629
16301630 /// On Windows, `\\server` or `\\server\share` was not found.
......@@ -1647,7 +1647,7 @@ pub const OpenError = error{
16471647} || UnexpectedError;
16481648
16491649/// Open and possibly create a file. Keeps trying if it gets interrupted.
1650/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1650/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
16511651/// On WASI, `file_path` should be encoded as valid UTF-8.
16521652/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
16531653/// See also `openZ`.
......@@ -1662,7 +1662,7 @@ pub fn open(file_path: []const u8, flags: O, perm: mode_t) OpenError!fd_t {
16621662}
16631663
16641664/// Open and possibly create a file. Keeps trying if it gets interrupted.
1665/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1665/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
16661666/// On WASI, `file_path` should be encoded as valid UTF-8.
16671667/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
16681668/// See also `open`.
......@@ -1710,7 +1710,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: O, perm: mode_t) OpenError!fd_t {
17101710
17111711/// Open and possibly create a file. Keeps trying if it gets interrupted.
17121712/// `file_path` is relative to the open directory handle `dir_fd`.
1713/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1713/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
17141714/// On WASI, `file_path` should be encoded as valid UTF-8.
17151715/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
17161716/// See also `openatZ`.
......@@ -1833,7 +1833,7 @@ fn openOptionsFromFlagsWasi(oflag: O) OpenError!WasiOpenOptions {
18331833
18341834/// Open and possibly create a file. Keeps trying if it gets interrupted.
18351835/// `file_path` is relative to the open directory handle `dir_fd`.
1836/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1836/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
18371837/// On WASI, `file_path` should be encoded as valid UTF-8.
18381838/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
18391839/// See also `openat`.
......@@ -2137,7 +2137,7 @@ pub const SymLinkError = error{
21372137 InvalidUtf8,
21382138
21392139 /// Windows-only; file paths provided by the user must be valid WTF-8.
2140 /// https://simonsapin.github.io/wtf-8/
2140 /// https://wtf-8.codeberg.page/
21412141 InvalidWtf8,
21422142
21432143 BadPathName,
......@@ -2146,7 +2146,7 @@ pub const SymLinkError = error{
21462146/// Creates a symbolic link named `sym_link_path` which contains the string `target_path`.
21472147/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
21482148/// one; the latter case is known as a dangling link.
2149/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2149/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
21502150/// On WASI, both paths should be encoded as valid UTF-8.
21512151/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
21522152/// If `sym_link_path` exists, it will not be overwritten.
......@@ -2198,7 +2198,7 @@ pub fn symlinkZ(target_path: [*:0]const u8, sym_link_path: [*:0]const u8) SymLin
21982198/// `target_path` **relative** to `newdirfd` directory handle.
21992199/// A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent
22002200/// one; the latter case is known as a dangling link.
2201/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2201/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
22022202/// On WASI, both paths should be encoded as valid UTF-8.
22032203/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
22042204/// If `sym_link_path` exists, it will not be overwritten.
......@@ -2446,7 +2446,7 @@ pub const UnlinkError = error{
24462446 InvalidUtf8,
24472447
24482448 /// Windows-only; file paths provided by the user must be valid WTF-8.
2449 /// https://simonsapin.github.io/wtf-8/
2449 /// https://wtf-8.codeberg.page/
24502450 InvalidWtf8,
24512451
24522452 /// On Windows, file paths cannot contain these characters:
......@@ -2458,7 +2458,7 @@ pub const UnlinkError = error{
24582458} || UnexpectedError;
24592459
24602460/// Delete a name and possibly the file it refers to.
2461/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2461/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
24622462/// On WASI, `file_path` should be encoded as valid UTF-8.
24632463/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
24642464/// See also `unlinkZ`.
......@@ -2522,7 +2522,7 @@ pub const UnlinkatError = UnlinkError || error{
25222522};
25232523
25242524/// Delete a file name and possibly the file it refers to, based on an open directory handle.
2525/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2525/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
25262526/// On WASI, `file_path` should be encoded as valid UTF-8.
25272527/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
25282528/// Asserts that the path parameter has no null bytes.
......@@ -2637,7 +2637,7 @@ pub const RenameError = error{
26372637 /// WASI-only; file paths must be valid UTF-8.
26382638 InvalidUtf8,
26392639 /// Windows-only; file paths provided by the user must be valid WTF-8.
2640 /// https://simonsapin.github.io/wtf-8/
2640 /// https://wtf-8.codeberg.page/
26412641 InvalidWtf8,
26422642 BadPathName,
26432643 NoDevice,
......@@ -2654,7 +2654,7 @@ pub const RenameError = error{
26542654} || UnexpectedError;
26552655
26562656/// Change the name or location of a file.
2657/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2657/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
26582658/// On WASI, both paths should be encoded as valid UTF-8.
26592659/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
26602660pub fn rename(old_path: []const u8, new_path: []const u8) RenameError!void {
......@@ -2716,7 +2716,7 @@ pub fn renameW(old_path: [*:0]const u16, new_path: [*:0]const u16) RenameError!v
27162716}
27172717
27182718/// Change the name or location of a file based on an open directory handle.
2719/// On Windows, both paths should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2719/// On Windows, both paths should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
27202720/// On WASI, both paths should be encoded as valid UTF-8.
27212721/// On other platforms, both paths are an opaque sequence of bytes with no particular encoding.
27222722pub fn renameat(
......@@ -2824,7 +2824,7 @@ pub fn renameatZ(
28242824}
28252825
28262826/// Same as `renameat` but Windows-only and the path parameters are
2827/// [WTF-16](https://simonsapin.github.io/wtf-8/#potentially-ill-formed-utf-16) encoded.
2827/// [WTF-16](https://wtf-8.codeberg.page/#potentially-ill-formed-utf-16) encoded.
28282828pub fn renameatW(
28292829 old_dir_fd: fd_t,
28302830 old_path_w: []const u16,
......@@ -2930,7 +2930,7 @@ pub fn renameatW(
29302930 }
29312931}
29322932
2933/// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
2933/// On Windows, `sub_dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
29342934/// On WASI, `sub_dir_path` should be encoded as valid UTF-8.
29352935/// On other platforms, `sub_dir_path` is an opaque sequence of bytes with no particular encoding.
29362936pub fn mkdirat(dir_fd: fd_t, sub_dir_path: []const u8, mode: mode_t) MakeDirError!void {
......@@ -3040,7 +3040,7 @@ pub const MakeDirError = error{
30403040 /// WASI-only; file paths must be valid UTF-8.
30413041 InvalidUtf8,
30423042 /// Windows-only; file paths provided by the user must be valid WTF-8.
3043 /// https://simonsapin.github.io/wtf-8/
3043 /// https://wtf-8.codeberg.page/
30443044 InvalidWtf8,
30453045 BadPathName,
30463046 NoDevice,
......@@ -3050,7 +3050,7 @@ pub const MakeDirError = error{
30503050
30513051/// Create a directory.
30523052/// `mode` is ignored on Windows and WASI.
3053/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3053/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
30543054/// On WASI, `dir_path` should be encoded as valid UTF-8.
30553055/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
30563056pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void {
......@@ -3066,7 +3066,7 @@ pub fn mkdir(dir_path: []const u8, mode: mode_t) MakeDirError!void {
30663066}
30673067
30683068/// Same as `mkdir` but the parameter is null-terminated.
3069/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3069/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
30703070/// On WASI, `dir_path` should be encoded as valid UTF-8.
30713071/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
30723072pub fn mkdirZ(dir_path: [*:0]const u8, mode: mode_t) MakeDirError!void {
......@@ -3132,7 +3132,7 @@ pub const DeleteDirError = error{
31323132 /// WASI-only; file paths must be valid UTF-8.
31333133 InvalidUtf8,
31343134 /// Windows-only; file paths provided by the user must be valid WTF-8.
3135 /// https://simonsapin.github.io/wtf-8/
3135 /// https://wtf-8.codeberg.page/
31363136 InvalidWtf8,
31373137 BadPathName,
31383138 /// On Windows, `\\server` or `\\server\share` was not found.
......@@ -3140,7 +3140,7 @@ pub const DeleteDirError = error{
31403140} || UnexpectedError;
31413141
31423142/// Deletes an empty directory.
3143/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3143/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
31443144/// On WASI, `dir_path` should be encoded as valid UTF-8.
31453145/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
31463146pub fn rmdir(dir_path: []const u8) DeleteDirError!void {
......@@ -3160,7 +3160,7 @@ pub fn rmdir(dir_path: []const u8) DeleteDirError!void {
31603160}
31613161
31623162/// Same as `rmdir` except the parameter is null-terminated.
3163/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3163/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
31643164/// On WASI, `dir_path` should be encoded as valid UTF-8.
31653165/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
31663166pub fn rmdirZ(dir_path: [*:0]const u8) DeleteDirError!void {
......@@ -3213,12 +3213,12 @@ pub const ChangeCurDirError = error{
32133213 /// WASI-only; file paths must be valid UTF-8.
32143214 InvalidUtf8,
32153215 /// Windows-only; file paths provided by the user must be valid WTF-8.
3216 /// https://simonsapin.github.io/wtf-8/
3216 /// https://wtf-8.codeberg.page/
32173217 InvalidWtf8,
32183218} || UnexpectedError;
32193219
32203220/// Changes the current working directory of the calling process.
3221/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3221/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
32223222/// On WASI, `dir_path` should be encoded as valid UTF-8.
32233223/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
32243224pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {
......@@ -3238,7 +3238,7 @@ pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {
32383238}
32393239
32403240/// Same as `chdir` except the parameter is null-terminated.
3241/// On Windows, `dir_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3241/// On Windows, `dir_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
32423242/// On WASI, `dir_path` should be encoded as valid UTF-8.
32433243/// On other platforms, `dir_path` is an opaque sequence of bytes with no particular encoding.
32443244pub fn chdirZ(dir_path: [*:0]const u8) ChangeCurDirError!void {
......@@ -3315,7 +3315,7 @@ pub const ReadLinkError = error{
33153315 /// WASI-only; file paths must be valid UTF-8.
33163316 InvalidUtf8,
33173317 /// Windows-only; file paths provided by the user must be valid WTF-8.
3318 /// https://simonsapin.github.io/wtf-8/
3318 /// https://wtf-8.codeberg.page/
33193319 InvalidWtf8,
33203320 BadPathName,
33213321 /// Windows-only. This error may occur if the opened reparse point is
......@@ -3326,11 +3326,11 @@ pub const ReadLinkError = error{
33263326} || UnexpectedError;
33273327
33283328/// Read value of a symbolic link.
3329/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3329/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
33303330/// On WASI, `file_path` should be encoded as valid UTF-8.
33313331/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
33323332/// The return value is a slice of `out_buffer` from index 0.
3333/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3333/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
33343334/// On WASI, the result is encoded as UTF-8.
33353335/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
33363336pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 {
......@@ -3346,7 +3346,7 @@ pub fn readlink(file_path: []const u8, out_buffer: []u8) ReadLinkError![]u8 {
33463346}
33473347
33483348/// Windows-only. Same as `readlink` except `file_path` is WTF16 LE encoded.
3349/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3349/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
33503350/// See also `readlinkZ`.
33513351pub fn readlinkW(file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {
33523352 return windows.ReadLink(fs.cwd().fd, file_path, out_buffer);
......@@ -3381,11 +3381,11 @@ pub fn readlinkZ(file_path: [*:0]const u8, out_buffer: []u8) ReadLinkError![]u8
33813381}
33823382
33833383/// Similar to `readlink` except reads value of a symbolink link **relative** to `dirfd` directory handle.
3384/// On Windows, `file_path` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3384/// On Windows, `file_path` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
33853385/// On WASI, `file_path` should be encoded as valid UTF-8.
33863386/// On other platforms, `file_path` is an opaque sequence of bytes with no particular encoding.
33873387/// The return value is a slice of `out_buffer` from index 0.
3388/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3388/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
33893389/// On WASI, the result is encoded as UTF-8.
33903390/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
33913391/// See also `readlinkatWasi`, `realinkatZ` and `realinkatW`.
......@@ -3423,7 +3423,7 @@ pub fn readlinkatWasi(dirfd: fd_t, file_path: []const u8, out_buffer: []u8) Read
34233423}
34243424
34253425/// Windows-only. Same as `readlinkat` except `file_path` is null-terminated, WTF16 LE encoded.
3426/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
3426/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
34273427/// See also `readlinkat`.
34283428pub fn readlinkatW(dirfd: fd_t, file_path: []const u16, out_buffer: []u8) ReadLinkError![]u8 {
34293429 return windows.ReadLink(dirfd, file_path, out_buffer);
......@@ -5058,13 +5058,13 @@ pub const AccessError = error{
50585058 /// WASI-only; file paths must be valid UTF-8.
50595059 InvalidUtf8,
50605060 /// Windows-only; file paths provided by the user must be valid WTF-8.
5061 /// https://simonsapin.github.io/wtf-8/
5061 /// https://wtf-8.codeberg.page/
50625062 InvalidWtf8,
50635063} || UnexpectedError;
50645064
50655065/// check user's permissions for a file
50665066///
5067/// * On Windows, asserts `path` is valid [WTF-8](https://simonsapin.github.io/wtf-8/).
5067/// * On Windows, asserts `path` is valid [WTF-8](https://wtf-8.codeberg.page/).
50685068/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.
50695069/// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding.
50705070///
......@@ -5115,7 +5115,7 @@ pub fn accessZ(path: [*:0]const u8, mode: u32) AccessError!void {
51155115
51165116/// Check user's permissions for a file, based on an open directory handle.
51175117///
5118/// * On Windows, asserts `path` is valid [WTF-8](https://simonsapin.github.io/wtf-8/).
5118/// * On Windows, asserts `path` is valid [WTF-8](https://wtf-8.codeberg.page/).
51195119/// * On WASI, invalid UTF-8 passed to `path` causes `error.InvalidUtf8`.
51205120/// * On other platforms, `path` is an opaque sequence of bytes with no particular encoding.
51215121///
......@@ -5635,7 +5635,7 @@ pub const RealPathError = error{
56355635 PipeBusy,
56365636
56375637 /// Windows-only; file paths provided by the user must be valid WTF-8.
5638 /// https://simonsapin.github.io/wtf-8/
5638 /// https://wtf-8.codeberg.page/
56395639 InvalidWtf8,
56405640
56415641 /// On Windows, `\\server` or `\\server\share` was not found.
......@@ -5660,7 +5660,7 @@ pub const RealPathError = error{
56605660/// Expands all symbolic links and resolves references to `.`, `..`, and
56615661/// extra `/` characters in `pathname`.
56625662///
5663/// On Windows, `pathname` should be encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
5663/// On Windows, `pathname` should be encoded as [WTF-8](https://wtf-8.codeberg.page/).
56645664///
56655665/// On other platforms, `pathname` is an opaque sequence of bytes with no particular encoding.
56665666///
......@@ -5668,7 +5668,7 @@ pub const RealPathError = error{
56685668///
56695669/// See also `realpathZ` and `realpathW`.
56705670///
5671/// * On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
5671/// * On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
56725672/// * On other platforms, the result is an opaque sequence of bytes with no particular encoding.
56735673///
56745674/// Calling this function is usually a bug.
......@@ -5745,7 +5745,7 @@ pub fn realpathZ(pathname: [*:0]const u8, out_buffer: *[max_path_bytes]u8) RealP
57455745///
57465746/// Same as `realpath` except `pathname` is WTF16LE-encoded.
57475747///
5748/// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
5748/// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
57495749///
57505750/// Calling this function is usually a bug.
57515751pub fn realpathW(pathname: []const u16, out_buffer: *[max_path_bytes]u8) RealPathError![]u8 {
lib/std/process.zig+17-17
......@@ -20,7 +20,7 @@ pub const changeCurDirZ = posix.chdirZ;
2020pub const GetCwdError = posix.GetCwdError;
2121
2222/// The result is a slice of `out_buffer`, from index `0`.
23/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
23/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
2424/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
2525pub fn getCwd(out_buffer: []u8) ![]u8 {
2626 return posix.getcwd(out_buffer);
......@@ -29,7 +29,7 @@ pub fn getCwd(out_buffer: []u8) ![]u8 {
2929pub const GetCwdAllocError = Allocator.Error || posix.GetCwdError;
3030
3131/// Caller must free the returned memory.
32/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
32/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
3333/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
3434pub fn getCwdAlloc(allocator: Allocator) ![]u8 {
3535 // The use of max_path_bytes here is just a heuristic: most paths will fit
......@@ -139,7 +139,7 @@ pub const EnvMap = struct {
139139 /// Same as `put` but the key and value become owned by the EnvMap rather
140140 /// than being copied.
141141 /// If `putMove` fails, the ownership of key and value does not transfer.
142 /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string.
142 /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string.
143143 pub fn putMove(self: *EnvMap, key: []u8, value: []u8) !void {
144144 assert(unicode.wtf8ValidateSlice(key));
145145 const get_or_put = try self.hash_map.getOrPut(key);
......@@ -152,7 +152,7 @@ pub const EnvMap = struct {
152152 }
153153
154154 /// `key` and `value` are copied into the EnvMap.
155 /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string.
155 /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string.
156156 pub fn put(self: *EnvMap, key: []const u8, value: []const u8) !void {
157157 assert(unicode.wtf8ValidateSlice(key));
158158 const value_copy = try self.copy(value);
......@@ -171,7 +171,7 @@ pub const EnvMap = struct {
171171
172172 /// Find the address of the value associated with a key.
173173 /// The returned pointer is invalidated if the map resizes.
174 /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string.
174 /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string.
175175 pub fn getPtr(self: EnvMap, key: []const u8) ?*[]const u8 {
176176 assert(unicode.wtf8ValidateSlice(key));
177177 return self.hash_map.getPtr(key);
......@@ -180,7 +180,7 @@ pub const EnvMap = struct {
180180 /// Return the map's copy of the value associated with
181181 /// a key. The returned string is invalidated if this
182182 /// key is removed from the map.
183 /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string.
183 /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string.
184184 pub fn get(self: EnvMap, key: []const u8) ?[]const u8 {
185185 assert(unicode.wtf8ValidateSlice(key));
186186 return self.hash_map.get(key);
......@@ -188,7 +188,7 @@ pub const EnvMap = struct {
188188
189189 /// Removes the item from the map and frees its value.
190190 /// This invalidates the value returned by get() for this key.
191 /// On Windows `key` must be a valid [WTF-8](https://simonsapin.github.io/wtf-8/) string.
191 /// On Windows `key` must be a valid [WTF-8](https://wtf-8.codeberg.page/) string.
192192 pub fn remove(self: *EnvMap, key: []const u8) void {
193193 assert(unicode.wtf8ValidateSlice(key));
194194 const kv = self.hash_map.fetchRemove(key) orelse return;
......@@ -387,14 +387,14 @@ pub const GetEnvVarOwnedError = error{
387387 EnvironmentVariableNotFound,
388388
389389 /// On Windows, environment variable keys provided by the user must be valid WTF-8.
390 /// https://simonsapin.github.io/wtf-8/
390 /// https://wtf-8.codeberg.page/
391391 InvalidWtf8,
392392};
393393
394394/// Caller must free returned memory.
395/// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/),
395/// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/),
396396/// then `error.InvalidWtf8` is returned.
397/// On Windows, the value is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
397/// On Windows, the value is encoded as [WTF-8](https://wtf-8.codeberg.page/).
398398/// On other platforms, the value is an opaque sequence of bytes with no particular encoding.
399399pub fn getEnvVarOwned(allocator: Allocator, key: []const u8) GetEnvVarOwnedError![]u8 {
400400 if (native_os == .windows) {
......@@ -469,11 +469,11 @@ pub const HasEnvVarError = error{
469469 OutOfMemory,
470470
471471 /// On Windows, environment variable keys provided by the user must be valid WTF-8.
472 /// https://simonsapin.github.io/wtf-8/
472 /// https://wtf-8.codeberg.page/
473473 InvalidWtf8,
474474};
475475
476/// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/),
476/// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/),
477477/// then `error.InvalidWtf8` is returned.
478478pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
479479 if (native_os == .windows) {
......@@ -491,7 +491,7 @@ pub fn hasEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
491491 }
492492}
493493
494/// On Windows, if `key` is not valid [WTF-8](https://simonsapin.github.io/wtf-8/),
494/// On Windows, if `key` is not valid [WTF-8](https://wtf-8.codeberg.page/),
495495/// then `error.InvalidWtf8` is returned.
496496pub fn hasNonEmptyEnvVar(allocator: Allocator, key: []const u8) HasEnvVarError!bool {
497497 if (native_os == .windows) {
......@@ -737,7 +737,7 @@ pub const ArgIteratorWindows = struct {
737737
738738 /// Returns the next argument and advances the iterator. Returns `null` if at the end of the
739739 /// command-line string. The iterator owns the returned slice.
740 /// The result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
740 /// The result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
741741 pub fn next(self: *ArgIteratorWindows) ?[:0]const u8 {
742742 return self.nextWithStrategy(next_strategy);
743743 }
......@@ -771,7 +771,7 @@ pub const ArgIteratorWindows = struct {
771771 // check to see if we've emitted two consecutive surrogate
772772 // codepoints that form a valid surrogate pair in order
773773 // to ensure that we're always emitting well-formed WTF-8
774 // (https://simonsapin.github.io/wtf-8/#concatenating).
774 // (https://wtf-8.codeberg.page/#concatenating).
775775 //
776776 // If we do have a valid surrogate pair, we need to emit
777777 // the UTF-8 sequence for the codepoint that they encode
......@@ -1196,7 +1196,7 @@ pub const ArgIterator = struct {
11961196
11971197 /// Get the next argument. Returns 'null' if we are at the end.
11981198 /// Returned slice is pointing to the iterator's internal buffer.
1199 /// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1199 /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
12001200 /// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
12011201 pub fn next(self: *ArgIterator) ?([:0]const u8) {
12021202 return self.inner.next();
......@@ -1234,7 +1234,7 @@ pub fn argsWithAllocator(allocator: Allocator) ArgIterator.InitError!ArgIterator
12341234}
12351235
12361236/// Caller must call argsFree on result.
1237/// On Windows, the result is encoded as [WTF-8](https://simonsapin.github.io/wtf-8/).
1237/// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/).
12381238/// On other platforms, the result is an opaque sequence of bytes with no particular encoding.
12391239pub fn argsAlloc(allocator: Allocator) ![][:0]u8 {
12401240 // TODO refactor to only make 1 allocation.
lib/std/process/Child.zig+1-1
......@@ -162,7 +162,7 @@ pub const SpawnError = error{
162162 NoDevice,
163163
164164 /// Windows-only. `cwd` or `argv` was provided and it was invalid WTF-8.
165 /// https://simonsapin.github.io/wtf-8/
165 /// https://wtf-8.codeberg.page/
166166 InvalidWtf8,
167167
168168 /// Windows-only. `cwd` was provided, but the path did not exist when spawning the child process.