3 ms·
All strings in a physical machine are in some encoding. I/O almost always requires transcoding, except in the unlikely event that the destination encoding happe
by barrkel 17y ago
All strings in a physical machine are in some encoding. I/O almost always requires transcoding, except in the unlikely event that the destination encoding happens to match the chosen language's in-memory encoding.
If you create a wide-char string (C++'s most obvious candidate for full Unicode-level support), and print it out to the console using wcout, the programmer should reasonably expect the library to perform transcoding as necessary to match the destination (providing things are configured correctly).
The fact that \u20ac maps to a code point in UCS2 or UTF-16 when encoding a wide string in text format for the compiler to read, is all but irrelevant. So long as the final data at runtime is in a valid encoding that matches its type, the runtime library should handle everything from there.