4

I recently download some C++ source code which is written by Russian. When I open the project in my MSVC(VC2008 Chinese edition), the comments of codes is hard too see. And When I compile the code, it generates many many warnings and errors. such as this case: "error C2001: newline in constant"

TCHAR text[]=_T("卿羼?祛驽?猁螯 忄 疱觌囔?); 

I think people who use Windows OS Russian edition may not meet this problem. The Problem is, how can I handle foreign languages in this occasion ? I want to display the code and comments rightly in my VC++ IDE, and thus can compile the codes, how to achieve this goal?

I feel sorry that I don't know whether I explained this problem clearly or not, and the title of this problem is properly?

1
  • the display of different charsets is the responsibility of the windows, in addition to that try to set the project to use Unicode libraries Commented May 25, 2013 at 8:23

1 Answer 1

2

Try to convert all code files from CP1251 (or KOI8-R, not sure, have to try) to any Unicode encoding, like UTF-8 with BOM. Notepad++ could be used for this, but Visual Studio can also be used:

Open files in Visual Studio, but instead of just double-clicking them do: right-click in Solution Explorer > Open With... > C++ source code editor (with encoding) > "Cyrillic (Windows) - Codepage 1251" (or some other Cyrillic encoding).

To save the file in Unicode encoding do: File menu > Save As... > click on triangle sign within Save button and choose Save with Encoding... > confirm overwrite > choose any Unicode encoding, like "Unicode (UTF-8 with signature) - Codepage 65001".

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.