std::string vs std::wstring

Started by
11 comments, last by benryves 15 years, 3 months ago
Quote:Original post by adeyblue
It's the first link (pastebin) in my post above.


Gotcha. Sorry, missed that earlier. That's pretty slick. It hadn't occurred to me to try to use such a technique to call the proper version. Nice work.

That will easily take care of the Win32 cases, because of the consistent style. I suppose the technique could also be applied to standard C functions with some care.
Advertisement
Would there be any advantage, then, to using std::wstring over std::string? Would an application that just outputs characters to the bottom half of a byte value be recognized as UTF-8, instead of/as well as ASCII?
If you're just storing the string then I don't know if that would be a problem. What would be a problem is if you were manipulating the string in some way (substrings, case conversions, retrieving the length) as the routines would be operating on the byte rather than character level.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

This topic is closed to new replies.

Advertisement