latin9 characters in filesystem and command line; std.encoding [ISO-8859-15]
kdevel
kdevel at vogtner.de
Sun Mar 17 22:11:38 UTC 2019
This program:
```ls.d
import std.stdio;
import std.file;
void main (string [] args)
{
auto entries = dirEntries (args[1], SpanMode.shallow, false);
foreach (e; entries)
writeln (e.name);
}
```
lists the contents of a directory even if args[1] and the
filesystem contain names encoded in latin9 (ISO-8859-15). I
wonder if this behavior can be relied on. Does this use conform
to the "spirit of D" where strings are assumed to be in in UTF-8
format [1]?
Second question: Has anybody ever managed to extend std.encoding
which lacks a latin9 encoding?
[1] https://dlang.org/spec/arrays.html#strings
More information about the Digitalmars-d-learn
mailing list