Timeline for std::wstring VS std::string
Current License: CC BY-SA 2.5
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2018 at 14:48 | comment | added | Ruslan |
@MihaiDanila at least we do have std::codecvt<charNN_t, char> etc. since C++11 for conversion between UTF-NN and UTF-8. Though, std::wstring_convert is deprecated since C++17...
|
|
May 22, 2017 at 14:40 | comment | added | Mihai Danila | @underscore_d Support for storing encoded Unicode codepoints into bytes is hardly notable as "support". And, yes, I agree that the absence of standard Unicode support in this language in the 21st century is laughable. | |
May 21, 2017 at 14:11 | comment | added | underscore_d | @MihaiDanila That depends on how you define "native support". Can it store Unicode character sequences? Absolutely. Does it provide any standard class that can operate on such sequences in terms of the number of displayed characters therein, rather than just naively indexing/finding/etc by numbers of bytes, thereby possibly breaking up sequences of codepoints and getting things horribly wrong? No. And that's awful. This is 2017. I can only hope that, since we're finally getting standard filesystem and network support, maybe actual Unicode strings are faintly visible somewhere over the horizon. | |
Jan 8, 2015 at 22:20 | comment | added | Deduplicator |
"But it won't understand the meaning of unicode code points." On windows, neither does std::wstring .
|
|
Dec 15, 2013 at 16:56 | comment | added | Mihai Danila | Are you guys in essence saying that C++ doesn't have native support for the Unicode character set? | |
May 16, 2010 at 17:26 | comment | added | Logan Capaldo | "This means your wstring's s.size() function will then return the right amount of wchar_t elements and logical characters." This is not entirely accurate, even for Unicode. It would be more accurate to say codepoint than "logical character", even in UTF-32 a given character may be composed of multiple codepoints. | |
Dec 31, 2008 at 12:26 | comment | added | Johannes Schaub - litb | yes, jalf. c89 specifies minimal ranges for basic types in its documentation of limits.h (for unsigned char, that's 0..255 min), and a pure binary system for integer types. it follows char, unsigned char and signed char have minimum bit lengths of 8. c++ inherits those rules. | |
Dec 31, 2008 at 12:11 | comment | added | Stack Overflow is garbage | I'm curious about #2. I thought 7 bits would be technically valid too? Or is it required to be able to store anything past 7-bit ASCII chars? | |
Dec 31, 2008 at 12:00 | history | edited | Johannes Schaub - litb | CC BY-SA 2.5 |
added 233 characters in body
|
Dec 31, 2008 at 11:48 | history | answered | Johannes Schaub - litb | CC BY-SA 2.5 |