Hi. I have a cpp file that uses ibm cp437 and Visual C++ keeps reading it with windows-1252. How do I make Visual C++ use the right code page for the file?
A:
Unless you need the CP437 encoding, why don't you convert it to CP1252, UTF-8 or MS 'Unicode' (UCS-2)? Any reasonably capable editor should be able to do it.
VS2008 can do it - check out the Advanced Save option on the File menu.
Edit:
If you go to Source Control Explorer, right-click on the file, select 'Properties', you can set the encoding on the 'General' tab page. 'IBM437' is one of the choices.
DaveE
2010-03-05 02:03:34
A:
Alright, I figured it out myself. For the curious, here is the answer:
- Right click the file in the Solution Explorer.
- Select "Open With..."
- Choose "C++ Source Code Editor (with encoding)"
- A new box appears to specify Encoding. Choose "OEM United States - Codepage 437"
Done.
Spin City
2010-03-05 02:13:30
It wasn't exactly obvious that this was about source code instead of text files.
Hans Passant
2010-03-05 02:22:22
"I have a cpp file"...
jnylen
2010-03-05 03:03:59