Question

I have some UNICODE text in my win32 code. I have declared it something like this..

std::wstring a = Träna; //swedish for practice

I copy that value into a variable using something like...

std::wstring b = a;

While debugging I don't see what im supposed to get in b. I should be getting Träna in b, but what i get is Träna This is observed only on windows, the program works fine on OS X.

I'm sure its some rookie mistake, what am i missing here?

Was it helpful?

Solution

As @SigTerm and @jukka said above, the issue was with UTF-8 encoding.

After saving the cpp file in <Unicode UTF-8 with signature> the issue was solved. The file was earlier saved in <Unicode UTF-8 without signature>. It wasnt't the issue with prefixing L, i already have defined my variables like that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top