Linked Questions

-2 votes
3 answers
3k views

Possible Duplicate: Compare std::wstring and std::string I have silly question. I know I can use L prefix before a string to use it as wchar_t* (for unicode strings) but I dont know how to use ...
aliakbarian's user avatar
39 votes
7 answers
57k views

If I have a UTF-8 std::string how do I convert it to a UTF-16 std::wstring? Actually, I want to compare two Persian words.
aliakbarian's user avatar
73 votes
4 answers
16k views

The following may not qualify as a SO question; if it is out of bounds, please feel free to tell me to go away. The question here is basically, "Do I understand the C standard correctly and is this ...
Kerrek SB's user avatar
  • 480k
92 votes
1 answer
71k views

Following a related question, I'd like to ask about the new character and string literal types in C++11. It seems that we now have four sorts of characters and five sorts of string literals. The ...
Kerrek SB's user avatar
  • 480k
3 votes
1 answer
18k views

I have programmed some code but there is some problem. In this codes i am trying to convert string to wstring. But this string have "█" characters. This character have 219 ascii code. This conversion ...
Mehmet's user avatar
  • 43
2 votes
2 answers
3k views

As I understand it, different locales have different encodings. With ICU I'd like to convert from a UnicodeString to the current locale's encoding, and back. Specifically I'm using Boost's Filesystem ...
Jookia's user avatar
  • 6,930
4 votes
2 answers
903 views

I'm developing a game (actually I'm porting it from Gosu to SFML) in C++. I'm using GNU Gettext as the i18n system. As you know, gettext returns char * strings using the local encoding, usually UTF8. ...
José Tomás Tocino's user avatar
2 votes
1 answer
1k views

So we have such function: std::string url_encode_wstring(const std::wstring &input) { std::string output; int cbNeeded = WideCharToMultiByte(CP_UTF8, 0, input.c_str(), -1, ...
Rella's user avatar
  • 67.4k
1 vote
1 answer
234 views

I have a test function as follow: [TestMethod] void RipMichaelJacksonTest() { string expected = "Hello"; BSTR actual = SysAllocString(L"Hello"); Assert::AreEqual(...
RayOldProf's user avatar
  • 1,080
0 votes
1 answer
164 views

I am wondering is this adequate enough to use in a production codebase? std::wstring s2w(const std::string& s) { std::wstring ws; ws.assign(s.begin(), s.end()); return ws; } std::...
Kachinsky's user avatar
  • 573