C++ Logo


Advanced search

Re: [SG16-Unicode] [wg14/wg21 liaison] [isocpp-core] Source file encoding

From: Tom Honermann <tom_at_[hidden]>
Date: Wed, 14 Aug 2019 23:43:48 -0400
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?


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

Received on 2019-08-15 05:43:52