rust-lang / glob

Support for matching file paths against Unix shell style patterns.
http://doc.rust-lang.org/glob
Apache License 2.0
468 stars 76 forks source link

glob("*") does not support matching non-utf8 filenames #23

Open rust-highfive opened 9 years ago

rust-highfive commented 9 years ago

Issue by kballard Wednesday Jan 29, 2014 at 23:12 GMT

For earlier discussion, see https://github.com/rust-lang/rust/issues/11916

This issue was labelled with: A-libs, A-unicode, E-easy, E-mentor in the Rust repository


glob::glob() does not have any support right now for matching non-utf8 filenames. Not only are its patterns restricted to strings, but it also explicitly skips any non-utf8 filenames it encounters (which should at least be able to match a * pattern).

Tasks that need to be done:

This is a sub-task of #9639.

kornelski commented 6 years ago

I've ran into this. I wanted to emulate globs on Windows, but it allows unpaired surrogates in filenames, and therefore filename patterns also need to support unpaired surrogates.

Looks like the original issue refers to an old Rust trait. I suppose post Rust-1.0 it's going to be glob<P: AsRef<OsStr>>(pattern: P).