-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clients of the new path need to be updated for non-utf8 paths #9639
Comments
|
When formatted with |
@alexcrichton , so display will have lots of replacement characters for byte-based non-UTF-8 filesystems. Is that considered good enough? |
It's considered good enough in the sense that |
Yes, not round-tripping in all cases for display is fine. But in cases the filesystem is known to have a different encoding (see Python’s sys.getfilesystemencoding()), shouldn’t we try and use that? |
Right now we don't have a great story of encoding/decoding strings in and out of UTF-8, but it would be pretty awesome once that story gets fleshed out to support re-encoding as utf-8 if we know the filesystem is different. |
I agree. Being able to support other encodings based on the known filesystem encoding would be great. But that can be added later, once it's actually possible to do so. |
@kballard Thanks, I think that answers what I wanted to know. Supporting various character encodings is a separate issue. (See my API proposal on the wiki and related discussion on rust-dev linked from there.) But once we have that, dealing with filesystems in various encodings is something that should be fixed. |
@SimonSapin Yeah, this wasn't actually planned initially, but due to how |
This has largely been accomplished since this was written both in terms of an implementation strategy as well as propagating throughout the libraries. The stabilization passes we've been doing will turn up any more related clients, and I've requested that the remaining issue, #11916, be transferred to the rust-lang/rust repo, so closing. |
There is a FIXME related to this issue, |
…=Nilstrieb Handle non-utf8 rpaths (fix FIXME) Removes a FIXME for rust-lang#9639 which is closed since long ago. Part of rust-lang#44366 which is E-help-wanted. (Also see rust-lang#114377)
compiletest: Handle non-utf8 paths (fix FIXME) Removes the last FIXME in the code for rust-lang#9639 🎉 (which was closed 8 years ago) Part of rust-lang#44366 which is E-help-wanted. (The other two PRs that does this are rust-lang#114377 and rust-lang#114427)
compiletest: Handle non-utf8 paths (fix FIXME) Removes the last FIXME in the code for rust-lang#9639 🎉 (which was closed 8 years ago) Part of rust-lang#44366 which is E-help-wanted. (The other two PRs that does this are rust-lang#114377 and rust-lang#114427)
…=Nilstrieb Handle non-utf8 rpaths (fix FIXME) Removes a FIXME for rust-lang#9639 which is closed since long ago. Part of rust-lang#44366 which is E-help-wanted. (Also see rust-lang#114377)
…tf-8, r=thomcc test_get_dbpath_for_term(): handle non-utf8 paths (fix FIXME) Removes a FIXME for rust-lang#9639 Part of rust-lang#44366 which is E-help-wanted The remaining two FIXMEs for rust-lang#9639 are considerably more complicated, so I will create separate PRs for them.
The new Path module (coming soon) represents POSIX paths as vectors (#7225) of non-NUL bytes instead of as
~str
. This is because Linux allows for non-unicode paths.Unfortunately, there are a lot of clients of
Path
, including related functionality likeProcess
arguments and environment variables, that still use&str
. These need to be updated to handle&[u8]
so they can represent non-unicodePath
s.All of the known locations where this is an issue are marked up by
// FIXME
lines referencing this issue. Note that in the case ofProcess
args and environments, these comments are at the usage locations rather than the implementation.Sub-tasks that have been filed for various components:
glob("*")
does not support matching non-utf8 filenamesProcess::new
anddynamic_library::open_external
should take&[u8]
s, notPath
s or~strs
The text was updated successfully, but these errors were encountered: