VisualStudio2022 change file encoding

  This method can change the encoding of files in VS, and is also applicable in Unity3D or other projects. For example, to solve the problem of Unity3D Chinese encoding error, the default encoding of VS Chinese version is likely to be GB2312 encoding, and sometimes you need to switch to UTF-8 encoding format.

specific method

On the top menu bar, Extensions-Manage Extensions, open the Manage Extensions window.
Insert image description here
Search Encoding, find FileEnoding, click download (if the download is unsuccessful, you need to turn on VPN), and close VS after the download is completed. Wait until
Insert image description here
this interface appears, select Modify, and restart VS after the installation is complete.
Insert image description here
After restarting VS, you can see the option to change the encoding in the lower right corner of the file:
Insert image description here

Summarize

Generally speaking, the commonly used encodings for Chinese are UTF-8 and GB2312. UTF-8 is an internationally unified standard, and GB2312 is a Chinese standard. Use it according to the situation. By the way, the author of this plug-in seems to be from China:). If you have time, you can go to the plug-in and leave a positive review!
Insert image description here

Supongo que te gusta

Origin blog.csdn.net/qq_44284055/article/details/132004614
Recomendado
Clasificación