Am Sun, 5 Oct 2014 19:04:23 +0300
schrieb ketmar via Digitalmars-d <digitalmars-d@puremagic.com>:

> On Sun, 5 Oct 2014 17:44:31 +0200
> Marco Leise via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> 
> > From that I conclude, that File() should open files by ubyte[]
> > exclusively to be POSIX compliant.
> and yet there is currently no way in hell to open file with non-utf8
> name with hardcoded name and without ugly hacks with File("..."). and
> ubyte will not help here, as D has no way to represent non-utf8 string
> literal without unmaintainable shit like "\xNN".
> 
> and speaking about utf-8: for strings we at least have a hack, and for
> shebangs... nothing. nada. ничего. locale settings? other encodings? who
> needs that, there CAN'T be non-utf8 shebangs. OS interoperability? it's
> overhyped, there is only two kinds of OSes: those which are D-compatible
> and bad. changing your locale to non-utf8 magically turns your OS to
> bad, D will not try to interoperate with it anymore.

There comes the day that you have to let Sputnik go and board
the ISS.
Still I and a others agree with you that Phobos should not
assume Unicode locales everywhere, no need to rant.

What I find difficult is to define just where in std.stdio the
locale transcoding has to happen. Java probably just wraps
a stream in a stream in a stream as usual, but in std.stdio it
is just a File struct that more or less directly writes to the
file descriptor. So my guess is, the transcoding has to happen
at an earlier stage. Next, when output is NOT a terminal you
typically want to output with no transcoding or set it up
depending on your needs.
Personally I want transcoding to the system locale when
stdout/stderr is a terminal and UTF-8 for everything else
(i.e. pipes and files). That would be my defaults.

-- 
Marco

Attachment: signature.asc
Description: PGP signature

Reply via email to