3 ms·
> What is the encoding of zero and possibly slash delimited blobs of bytes (filenames, argv, envp…) that you get from and pass to the kernel? Bytes. Every numb
by matheusmoreira 3y ago
> What is the encoding of zero and possibly slash delimited blobs of bytes (filenames, argv, envp…) that you get from and pass to the kernel?
Bytes. Every number other than 0 and 47 is allowed. They should probably be treated as opaque blobs of binary data.
- ben0x539 3y agoWell, sometimes the users ask to see them and they don't like numbers very much.
- account42 3y agoAssuming UTF-8 for display works pretty well, as long as you still treat it as bytes for the actual file operations and don't corrupt the data because you expect valid UTF-8. Windows has the same problem where in most places the kernel will allow all WCHAR sequences (minus a short list of reserved ones) and gives you no guarantee that that's actually UTF-16.