Displaying Japanese fonts in source code using Visual Studio

前端 未结 7 2278
栀梦
栀梦 2021-01-02 05:04

I have some source files that have comments written in Japanese. When I open these files in Visual Studio they appear like this:

à–¾FNCAP‰¹—p‚̃XƒŒƒbƒh


        
相关标签:
7条回答
  • 2021-01-02 05:37

    You can also convert the text encoding to UTF-8 using Notepad++.

    1. Originally encoded as Shift-JIS:

      image1

    2. Convert to UTF-8:

      image2

    3. Save file.

    It should now display correctly regardless of local region.

    0 讨论(0)
  • 2021-01-02 05:48

    i have just gotten this problem and fixed it by changing config "files.encoding" in file "setting.json" . Go to Menu => File => Reference => setting to open the file. Search for "files.encoding" and change value to Encoding of your file (my file encoded in Shift-JIS , i checked ending by using Notpad++)

    0 讨论(0)
  • 2021-01-02 05:50

    I found a general solution to the problem. This worked for me in Chinese text for Visual Studio 2013 and Windows 8.1.

    per https://msdn.microsoft.com/en-us/library/ms246590.aspx

    1. As Administrator Click Start, click Control Panel, and then open Regional and Language Options (or Region in Windows 8).
    2. Click the Advanced tab. (or Administrative in Windows 8)
    3. In the Select a language to match the language version of the non-Unicode programs you want to use list, select the language you are currently using.
    4. Click OK.
    0 讨论(0)
  • 2021-01-02 05:50

    Windows 10 : --> Control Panel\Clock and Region\Region

    enter image description here enter image description here

    0 讨论(0)
  • 2021-01-02 05:54

    I faced the same issue and have found a solution that works for me.

    The problem is that the files aren't unicode and VS is trying to open them with an encoding that matches your location. Luckily, you can set Windows default behavior for non-unicode files. Check out this link, http://msdn.microsoft.com/en-us/library/ms246590.aspx. Look under "To correctly display characters that are not included in the current code page."

    These directions are incorrect for Windows 8 (I can't speak for 7 or older.) For Windows 8:

    1. Navigate to Control Panel
    2. Select Clock, Language, and Region (yeah they still have the comma before and)
    3. Region
    4. Administrative
    5. Change System Locale...
    6. Select the desired language from the "Current System Locale" drop down

    Most of your programs should continue to function in English as this setting is only applied when programs and files don't support unicode.

    0 讨论(0)
  • 2021-01-02 05:56

    Presumably VS is interpreting the file with the wrong encoding.

    Reopen it using "File -> Open -> File... -> Open -> Open With... -> Source Code (Text) Editor With Encoding" and try various encodings.

    0 讨论(0)
提交回复
热议问题