Implementation-defined behavior or not?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, I am on Windows OS where CHAR_BIT == 8.

I am trying to understand whether this behavior is implementation-defined
or not.

I have this string in UTF-8, and I am trying to understand if it is
implementation-defined:

std::string s = u8"€";

It's clear to me that char c = 0xC8 is implementation defined for the
reasons:
1. char's signedness depends on compiler..
2. If the value is beyond the representatable range of char say, -128 to
127, then again it is implementation-defined.

In the same way, I am trying to understand how the std::string case is
handled because its also uses char.

So, € in UTF-8 means E2 82 AC sequence of bytes in hex. If std::string uses
suppose signed version of char, don't they fall beyond the representable
range and therefore, their value is implementation defined in std::string?
Or, is this case actually well-defined?




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux