C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] [isocpp-core] What is the proper term for the locale dependent run-time character set/encoding used for the character classification and conversion functions?

From: Tom Honermann <tom_at_[hidden]>
Date: Mon, 12 Aug 2019 22:15:14 -0400
On 8/12/19 4:24 PM, Thiago Macieira wrote:
>
> This has broken down in recent decades because Clang and GCC do a pass-through
> from the source charset to the narrow execution charset. So you can't get the
> same for non-ASCII. The following source if encoded in Latin1:
>
> char str[] = "é";
>
> will not behave properly under UTF-8 execution charset at runtime. I don't
> know if -finput-charset=latin1 makes a difference.

Use of -finput-charset=latin1 does suffice for gcc to DTRT.

It is a little disappointing that no warning is issued, even when
-finput-charset=utf-8 is specified.

Tom.

>
> MSVC without /utf-8, on the other hand, has the traditional interpretation.
>

Received on 2019-08-13 04:15:18