Use UTF-8 by default for C++ source files
.cpp and .h files should be saved in a modern encoding such as UTF-8 by default (and the compiler would have to be updated to handle UTF-8 input as well). The use of the windows-1252 codepage really feels like something out of the 1980's. The rest of the world uses Unicode. Heck, as far as I know, most other VS project types use it. Can we *please* get the same in Visual C++?
Evgenij Vrublevskij commented
UTF-8 without BOM should be always used for all source files by default, without any exceptions. Other encodings are just obsolete and problematic. Also VS source editor should keep consistent line endings. It would be nice to have an ability to change default line endings from excess CR LF to just LF.
[Deleted User] commented
*******: The linked UV thread is about a utf8 capable crt. What does that have to do with the default file encoding for source files?
Andrew Pardoe [MSFT] commented
Please see this similar, more highly-rated suggestion: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/12481203-create-a-utf8-c-runtime.
UV suggestions with the most votes get looked at most often. You might consider consolidating your votes into the higher-rated issue.
Generally speaking, the default character encoding should be configurable. I believe it would be great if there were both user wide setting of default codepage and project/solution wide default codepage. Plus, having default line endings similarly configurable would be nice too. When writing code that must be portable it is very important to have a way to easily set up things like character encoding and line endings.
xte knagn commented
It's 2016 now and still no utf-8..
Tomáš Tintěra commented
Or at provide a way to set-up default encoding. Now possible via extensions: http://www.skorkin.com/2012/07/how-to-set-the-default-encoding-for-all-files-saved-in-visual-studio/#.Vj4kOtJ4ubg
Zhengzhong Zhang commented
Can't agree more. I only write c++ on visual studio and didn't find c++ was the only language using ANSI until now. I tried VB and C#, they use utf-8 by default. That's depressing.