[Issue 17962] New: dirEntries now truncates Unicode file names
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 3 04:46:18 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17962
Issue ID: 17962
Summary: dirEntries now truncates Unicode file names
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: issues.dlang at jmdavisProg.com
Thanks to https://github.com/dlang/phobos/pull/5758 (which I _think_ is just on
master and didn't make it into 2.077), std.file.dirEntries can no longer handle
Unicode file names. It now incorrectly combines countUntil with slicing a
string, and Unicode names get truncated.
For instance, if you do something like
foreach(de; dirEntries("foo", SpanMode.shallow))
{
if(de.isDir)
{
}
}
and the directory foo contains a file name with Unicode characters, then isDir
will throw a FileException, because de.name does not actually exist (since the
file's name was truncated).
--
More information about the Digitalmars-d-bugs
mailing list