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

native: Skip non-utf16 filename on Windows #13338

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@klutzy
Contributor

klutzy commented Apr 5, 2014

This fixes glob::test::test_lots_of_files test on my machine:
it entered C:\$Recycle.Bin\ and there were some system files with
non-utf16 names.

native: Skip non-utf16 filename on Windows
This fixes `glob::test::test_lots_of_files` test on my machine:
it entered `C:\$Recycle.Bin\` and there were some system files with
non-utf16 names.
@kballard

This comment has been minimized.

Show comment
Hide comment
@kballard

kballard Apr 5, 2014

Contributor

Can you give me an example of one of the names? I have a long-standing issue on my plate to reinvestigate filepaths on Windows due to rumors of non-utf16 names, but I don't have any concrete data on this.

Was it some sort of UCS2 name that's invalid UTF-16, or does Windows genuinely let you have names that aren't Unicode at all?

Contributor

kballard commented Apr 5, 2014

Can you give me an example of one of the names? I have a long-standing issue on my plate to reinvestigate filepaths on Windows due to rumors of non-utf16 names, but I don't have any concrete data on this.

Was it some sort of UCS2 name that's invalid UTF-16, or does Windows genuinely let you have names that aren't Unicode at all?

@klutzy

This comment has been minimized.

Show comment
Hide comment
@klutzy

klutzy Apr 5, 2014

Contributor

I (on win8) succeeded to create files with strange names: [0xd800, 0xdc00] (\U00010000), [0xdc00] (surrogate only) and [0xdc73, 0xdc79] (two low surrogates). The last example is even from system file of recycle bin.

Contributor

klutzy commented Apr 5, 2014

I (on win8) succeeded to create files with strange names: [0xd800, 0xdc00] (\U00010000), [0xdc00] (surrogate only) and [0xdc73, 0xdc79] (two low surrogates). The last example is even from system file of recycle bin.

@kballard

This comment has been minimized.

Show comment
Hide comment
@kballard

kballard Apr 5, 2014

Contributor

@klutzy Ok thanks, that sounds like it's still valid UCS2, just not UTF-16. So it's not a big surprise.

Still, it is a reason why WindowsPath may need to move to using [u8] internally instead of str, which is unfortunate.

Contributor

kballard commented Apr 5, 2014

@klutzy Ok thanks, that sounds like it's still valid UCS2, just not UTF-16. So it's not a big surprise.

Still, it is a reason why WindowsPath may need to move to using [u8] internally instead of str, which is unfortunate.

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Apr 5, 2014

Member

Interesting! I would also like to add a test for this to ensure that this doesn't crop up again. I'm also a little worried how librustuv handles this case.

I don't think that from rust you can easily create a non-utf16 filename, but you should be able to add a run-make test with a file already in the directory.

Member

alexcrichton commented Apr 5, 2014

Interesting! I would also like to add a test for this to ensure that this doesn't crop up again. I'm also a little worried how librustuv handles this case.

I don't think that from rust you can easily create a non-utf16 filename, but you should be able to add a run-make test with a file already in the directory.

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Apr 15, 2014

Member

Closing due to inactivity, but feel free to reopen with a rebase!

Member

alexcrichton commented Apr 15, 2014

Closing due to inactivity, but feel free to reopen with a rebase!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment