C++ Logo

SG16

Advanced search

Subject: Re: [SG16-Unicode] [wg14/wg21 liaison] [isocpp-core] Source file encoding
From: Tom Honermann (tom_at_[hidden])
Date: 2019-08-14 22:43:48


On 8/14/19 3:53 PM, Thiago Macieira wrote:
> On Wednesday, 14 August 2019 10:01:19 PDT Joseph Myers wrote:
>> The present implementation-defined interpretation of the byte sequence in
>> source files allows a default of "UTF-8 in strings, comments can use
>> arbitrary bytes" (which thus allows existing source files in a range of
>> ASCII-compatible 8-bit character sets if the non-ASCII characters only
>> appear in comments, without needing to tell the compiler which character
>> set is being used).
> That's not correct. MSVC does interpret the bytes in comments and will
> complain if it can't decode from the 8-bit ACS to UTF-16.

I think Joseph was speaking abstractly about a possible interpretation
of the standard and the behavior of gcc, not MSVC.

Does MSVC only complain when the /validate-charset option is enabled?

Tom.

>
> That also means most legacy 8-bit-encoded files with high-bit comments will
> not compile with /utf-8.
>


SG16 list run by sg16-owner@lists.isocpp.org