Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
unicode std::string
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Old Wolf, post: 2510966"] std::wstring does not specify any encoding type or any character set. The most common implementations of std::wstring use Unicode character set, and either UCS-4, UCS-2 or UTF-16 encoding. But this is not a requirement. std::string is appropriate for UTF-8. But you must remember that functions like size() and find() will apply to the encoded bytes, not to the decoded version. If that was your issue, then you could also say that std::wstring is not appropriate for any Unicode encoding, because of combining characters (ie. the string length won't match the number of display characters). Of course the correct answer is that you should engage your brain when manipulating Unicode strings, and be aware of these issues. Many applications do indeed use std::string for UTF-8 processing. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
unicode std::string
Top