none
Change current code page

    Question

  • Scenario:
    1. A project and all its file created under UTF-8 encoding
    2. A chinese simplified version windows 10 operating system
    3. A chinese simplified version visual studio 2015 installed in the system above

    Problem:
    • Now we open the project with the visual studio we installed, the visual studio will open those UTF-8 encoding file with encoding GB2312 or GBK, regardless what those file's encoding really are. And this will trigger the C4819 warning during compiling as the current code page is GB2312 or GBK.
    • One solution is to use another tool (such as notepad++) to open all files within the project with UTF-8 encoding  and convert them to GB2312 or GBK encoding.
    • But the solution above will leave the same problem to those people I want to share this project with as they might not working under GB2312 or GBK encoding.
    • Is there a way to change the "current code page" of the project? Is visual studio capable of specify code page for every project? 
    Saturday, April 09, 2016 3:20 PM

Answers

  • Hi Misairu.Gugu,

    According to your description, I create a file with UTF-8 encoding and open it with Visual Studio 2015. Then modify the encoding to GB2312 through File menu -> Advanced Save options. After I save this setting and re-open this file in Visual Studio 2015, it come back to UTF-8 encoding.

    This should be the design for Visual Studio and if you want to use is with GB2312 encoding, please save it as GB2312 with Notepad.

    If any ideas for this design, please submit your ideas to Visual Studio Connect and then share the feedback link here. It is benefit to other communities who has the same problem to vote and add comments for your feedback. Thanks for your feedback for Visual Studio Product.

    Best Regards,
    Weiwei

    • Marked as answer by Misairu.GuGu Monday, April 11, 2016 6:39 PM
    Monday, April 11, 2016 8:36 AM
    Moderator