Ask a questionAsk a question
 

General DiscussionEncoding of source files

  • Friday, January 16, 2009 12:01 PMLoïc Joly Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hello,

    I have just tried the CTP, and noticed the following issue. I opened a new projet, and tried this code which used to work just fine :

    #include <iostream> 
    using namespace std; 
     
    int main() 
        locale loc("French_france"); 
        locale::global(loc); 
        cout << "Bonjour à tous !" << endl; // French hello world 
     

    But with version 10, this prints a bad charecter instead of 'à' (same problem with any other accentueted character).

    I could track that to the fact the this newly created cpp file seems to be saved in utf-8 encoding. When I force the conversion in UCS-2 or MBCS, the code is working as before.

    I'm not sure it is a good choice to use as default source code encoding an encoding that is not really (or at least by default) supported by the language itself.


    Regards,


All Replies

  • Friday, January 16, 2009 10:15 PMBoris Jabes [MSFT]ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Bonjour Loic,

    This is indeed a known issue, the CTP build that we released does not have proper Unicode support in the IDE. We have since fixed this, and you should enjoy correct behavior when we release the next build externally.

    Thanks for the feedback!

    Boris Jabes, Visual C++ IDE