[SG16-Unicode] [isocpp-core] Source file encoding

Thiago Macieira thiago at macieira.org
Thu Aug 15 01:33:58 CEST 2019


On Wednesday, 14 August 2019 16:02:15 PDT Niall Douglas wrote:
> > You make it for the file in question, not the translation unit. That means
> > it won't affect #includes and terminates at the end of your #inclusion.
> I'd like a #pragma encoding binary, which means do no interpretation of
> the following as text at all.

That won't work for anything except narrow characters. How do you do a binary 
translation from source eto:

  char16_t c16[] = u"something";
  char32_t c32[] = U"something";

> Useful for a poor man's std::embed, I reckon. Especially for C.

Right, but std::embed should have its own semantic, regardless of text 
interpretation. It just imports bytes, period. That is orthogonal to the 
encoding of the source code that called std::embed().

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products





More information about the Unicode mailing list