0

I wonder, but my app stops before printing "\u064B"

std::wcout << L"{\"data\":\"string\",\"text\":\"\u00b2\u00b2\u064B BOB \u00b2\u00b2\u00b2}" << std::endl;

if I print:

std::wcout << L"{\"data\":\"string\",\"text\":\"\u00b2\u00b2\u00b2 BOB \u00b2\u00b2\u00b2}" << std::endl;

all is okay, why?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Nick Nikolaev
  • 141
  • 1
  • 7
  • 3
    Its unclear what your asking, perhaps show a literal example of the string in question and describe what you want to do with it. – Alex K. Nov 24 '15 at 15:59
  • Have you looked at std::wstring? http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring – Colin Nov 24 '15 at 16:38
  • ok i look into it, my question in general more about special characters witch appears then i work with some language. – Nick Nikolaev Nov 24 '15 at 18:15
  • I use MSVS C++ 2013, and i have problems then try promt in console lang-specific characters: "\u064B" This characrter is just dont show in console, i dont know why, andalgorithms witch i use such as jsonparser just crush my app then try to deal with characters like "\u064B" – Nick Nikolaev Nov 24 '15 at 18:17
  • Your program is possibly fine, but console support of Unicode in Windows is very limited. Search for questions about that topic to learn more. http://stackoverflow.com/search?q=windows+console+unicode – Adrian McCarthy Nov 24 '15 at 18:58

1 Answers1

1

You have to use "\\" when you want to print '\'

std::wcout << L"{\"data\":\"string\",\"text\":\"\\u00b2\\u00b2\\u064B BOB \\u00b2\\u00b2\\u00b2}" << std::endl;