I'm trying to convert a vector<wchar_t> to string (and then print it).
std::string(vector_.begin(), vector_.end());
This code works fine, except äöü ÄÖÜ ß. They will be converted to:
���
I also tried converting to wstring and printing with wcout, but I got the same issue.
Thanks in advance!
My Solution:
First I convert my
vector<wchar_t>to anutf16stringlike this:Then I use this function, I found somewhere on here:
I did not write the conversion function, but it works just as expected. With this I can successfully convert a
vector<wchar_t>tostring