Subject: Re: Questions for LEWG for P2093R4: Formatted output
From: Thiago Macieira (thiago_at_[hidden])
Date: 2021-03-21 11:47:23
On Sunday, 21 March 2021 06:40:44 PDT Victor Zverovich wrote:
> > Strictly speaking, that's implementation-defined. You can reopen stdout
> > with the ",css=<codec>" flag to fopen to cause transcoding to happen.
> Interesting, would it be standard-compliant? In any case, MSVC doesn't do it
> according to the test.
Yes, it's standards-compliant to transcode. The ",ccs" argument is not in the
C standard (see https://cigix.me/c17#22.214.171.124) nor POSIX but informing how
you want the C library to transcode does not prevent it from choosing to do so
on its own. The existence of wprintf() is sufficient reason for that ability
MS documentation is that the ",ccs" argument can be used to specify one of
the Unicode encodings, but not the ACP (I guess that's just the default). The
glibc documentation says that any encoding understood by iconv is valid there.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DPG Cloud Engineering
SG16 list run by firstname.lastname@example.org