Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1038

How to set Visual Studio to create new files as UTF-8 as default?

$
0
0

Is there any way to configure Visual Studio 2022 so that any kind of new file created from within the IDE will be UTF-8 encoded as default?

I personally find very annoying to stumble upon the same problem: I'm working on a ASP+React TypeScript project, so I have *.cs, *.ts, *.tsx, but also JSONs and other files. Apparently, when a new file is created, its encoding is Western Europe codepage. Thus, when I type a string like "caffè", it is rendered as "caff?" (something like that).

However, that's not just a aestethic/readability problem. I had to solve a bug where the comparison between two string failed, because the different encodings. Very annoying.

Sub-question: in our globalized world, is there any shortcoming to use UTF-8 as standard, and leave the single-byte/codepage encoding as esplicit demand?


Viewing all articles
Browse latest Browse all 1038

Trending Articles