character illegible when opened in VS2012 - visual-studio-2012

I have several classic asp pages that I've received from a client. When I open them in a simple text editor they are easily readable, however when I open them in Visual Studio, they look like they are in Chinese and unreadable (by me anyway).
How do I change the character set or correct this?
Thank you.

Related

Persian (Arabic) Support for Visual Studio Code

Visual Studio Code does not seem to display Persian or Arabic scripts nicely in the terminal window. I can confirm that on Linux, but not sure about macOS or Windows. Instead of displaying right-to-left languages from right to left, it chains characters to each other from left to right. I tried changing its terminal to one with good Persian support like Konsole from the settings, but it didn't work. Is there a way to solve this or do we have to request project maintainers to add the support?
A screen shot is attached to show the problem.
I had the same problems use the package linked below. You can use it to first convert the text and copy that and paste it into the terminal for input. I made it to correctly organize the Arabic characters and display them correctly. The library supports,
Arabic, Farsi, and English characters and symbols.
Check it out.
https://www.npmjs.com/package/rtl-arabic

MBCS File Menus generate ???? Characters

I am working on an MBCS app using MFC. I am trying to support Asian languages. For the purposes of this discussion, we'll say I'm trying to support Chinese. I am able to support Pop up dialogs via MessageBoxW and Dialog SCREENs by pasting Chinese characters directly into the RC file. I can't get file menus to work using either resource view or editing the RC file directly. Whenever I type in ANY Asian character, the screen shows ???. One ? for each character. I have tried modifying the menu in C++ using ModifyMenuW. I get more question marks. Visual Studio shows everything working, and the RC file is unicode (UTF-16). I can't easily convert my project to unicode mode. Spanish, French, and German all works fine (one of the Essets in German doesn't work, but that isn't a show stopper). What should I try next?
Thanks in advance!
Well, the easy answer would be change the application to Unicode, but this is not always simple, or possible at all.
Concerning using Unicode in a MBCS application, some things are possible and some others not. For example, I have made a MBCS application displaying and editing translations of program strings (messages, menues etc) in a ListView control, however ListView does have a specific message to turn it to Unicode (LVM_SETUNICODEFORMAT) and support operations (see also CCM_SETUNICODEFORMAT). Menus aren't controls though, but they do have "wide" (Unicode) functions.
If you want to use Unicode in your application, there are some tests you need to make. Success is not guaranteeded, but you can at least draw some conclusions and determine whether what you want to do is possible.
Test1:
You mentioned trying ModifyMenuW(), but this will try to modify an existing menu. Instead, try InsertMenuW() or InsertMenuItemW(). Any unicode string should be displayed properly, so try not just Chinese, but other laguages too (eg Greek or Russian). And btw, I can't see how French works and German doesn't (they use the same codepage - West European). What's the system codepage of your test-machine?
Test2: (if the above has failed)
Try changing the whole menu (SetMenu()) with having a single (unicode) menu item as its root.
Test3: (if the above have failed)
Then you need to check whether the window containing the menu must be Unicode. Create a simple "Hello World" Win32 application, or find a sample, if Visual Studio does not do this for you (these basically register the window class, create the main window and start the message-loop) - you must add a menu too, using the "wide" version of the menu functions explicitly. If this doesn't work, try changing the code that creates the window to unicode. This way you will know whether you need a unicode window, to own the menu.
Please make these tests and let us know the results. I will further post if needed.

DataSet designer opens as Xml editor

I had a power outage and while I am certain I saved my work recently something did go wrong. The xsd file I was editing in the Designer mode no longer opens in designer, when I double click it, I get the xml of it. Strangely enough any other xsd I open opens perfectly as design-view. Resetting VS settings doesn't seem to help, can it be something in my project?
goto your Solutions Explorer.
right click the dataset you are trying to open up.
Click "Open With"
you should get a dialog box come up, select "Dataset Editor" and press ok.
From here on you should be all set again.
Steve
The fastest way I could think of that would fix this problem, is to exclude that xsd(and its dependants) from the project, then in explorer delete all the files that have the same name as the xsd but not the xsd itself. Then add the xsd file back to project in Visual Studio and it will work fine again. The only downside is that it rearranges the visual aspect of the xsd :/
Hope it helps someone.
Look in the Error window and see if you have any errors, warnings, or messages about the XML. Also look in the Output window to see if there are any complaints.
SOLVED!
I edit the .cs file under of .xsd file. Edit this file and erase all. that's it, works for me.

How can handle foreign words in C++ code?

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?
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".

How do I change the code page MS Visual Studio 2008 uses to open files?

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?
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.
I also encountered these errors in my environments. I think there's any easier way to change the default code pages.
In windows 10, you could go to "Settings" -> "Region" -> "Administrative" tab -> "Language for non-Unicode programs". Then you could choose the region you want.
In this way, all the codes read from Visual Studio would use the code page whatever you want.
For example, the default setting for me is Chinese (Traditional, Taiwan). The code page is 950. But the codes are using windows-1252, therefore, I change the region to English (United States).
That's it.
Hope the solution could help you.
Thanks.
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.

Resources