David Webber
2009-10-08 14:57:33 UTC
I have a unicode console app.
It has the usual _tmain() [where t means unicode as the unicode setting is
on] with argc and argv.
A one of my arguments I have the string Iván, where the third letter is
produced with AltGr+A on my British keyboard. (U+00E1)
Suppose
CString sName;
is set to contain this string.
1. the debugger watch window shows it correctly.
2. If I output it in a message box, it is fine: exactly what I'd expect.
3. However
std::wcout << sName;
or
std::wcout << (LPCTSTR)sName;
buggers it up. Running the program
myprog "Iván"
in a console window gives me Ivßn (third character is German "scharfes s" =
U+00DF).
The same thing happens if I do
myprog "Iván" >> newfile.txt
(and the file which is created is ascii).
Something strange seems to be happening with wcout. Any ideas?
[My machine is English Windows Vista with default code page (I believe) set
to 1252 = Western European.]
Dave
It has the usual _tmain() [where t means unicode as the unicode setting is
on] with argc and argv.
A one of my arguments I have the string Iván, where the third letter is
produced with AltGr+A on my British keyboard. (U+00E1)
Suppose
CString sName;
is set to contain this string.
1. the debugger watch window shows it correctly.
2. If I output it in a message box, it is fine: exactly what I'd expect.
3. However
std::wcout << sName;
or
std::wcout << (LPCTSTR)sName;
buggers it up. Running the program
myprog "Iván"
in a console window gives me Ivßn (third character is German "scharfes s" =
U+00DF).
The same thing happens if I do
myprog "Iván" >> newfile.txt
(and the file which is created is ascii).
Something strange seems to be happening with wcout. Any ideas?
[My machine is English Windows Vista with default code page (I believe) set
to 1252 = Western European.]
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm