Home Print unicode char
Reply: 0

Print unicode char

user685
1#
user685 Published in April 24, 2018, 6:39 am

I tried a very simple code in C++:

#include <iostream>
#include <string>

int main()
{
  std::wstring test = L"asdfa-";
  test += u'ç';
  std::wcout << test;
}

But the result was:

asdfa-?

It was not possible print 'ç', with cout or wcout, how can I can print this string correctally?

OS: Linux.

Ps: I use wstring instead of string, because sometimes I need calculate the length of the string, and this size must be the same of what is on the screen.

Ps: I need concatenate the unicode char, it can't be on the string constructor.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.358507 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO