Search Issue Tracker
By Design
Votes
0
Found in [Package]
2.0.11
Issue ID
VS-47
Regression
Yes
The script encoding is chosen by System Locale setting instead of Unicode in Visual Studio on Windows
How to reproduce:
1. Create a new project
2. Create a new C# Script (Assets > Create > C# Script)
3. Open the newly created script
4. In Visual Studio menu bar go Tools > Customize...
5. In the "Customize" window go to "Commands" tab
6. Press the "Add Command..." button
7. In the "Add Command" window go to "File" category
8. In the "Commands" select "Advanced save options..." and press "Ok" at the bottom
9. Go back to Visual Studio and press on "Advanced save options..."
Expected result: The encoding is set to "Unicode (UTF-8 with signature) - Codepage 65001"
Actual result: The encoding is chosen according to your current System locale
Reproducible with: 2020.2.0a15, 2020.3.20f1, 2021.1.24f1, 2021.2.0b15, 2022.1.0a11
Not reproducible with: 2019.4.31f1, 2020.2.0a14
Reproducible using:
- Visual Studio 2017, Visual Studio 2019 and Visual Studio 2022
Not reproducible using:
- Visual Studio Code, Rider
Workaround:
- Enabling "Beta: Use Unicode UTF-8 for worldwide language support" in the Control Panel > Region > Administrative > Language for non-Unicode programs fixes the issue
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Draw Additional Lights Shadowmap" calls increase when custom MaterialBlockProperty is used
- Crash on _platform_memmove when importing the "Dragon Crashers - URP 2D Sample Project" to a new 2D project
- "Shader is not supported on this GPU" warnings and and shaders are not loading when building the project for non-Chromium browsers
- [iOS][URP] The screen flickers and the "Execution of the command buffer was aborted due to an error during execution" error is thrown continuously
- Shortcut Manager shows empty conflict filter when resolving runtime conflicts involving different contexts
Resolution Note:
Visual Studio encoding settings only apply to files created in Visual Studio. Its possible to change the encoding in visual studio of a file created elsewhere following this:
https://docs.microsoft.com/en-us/visualstudio/ide/how-to-save-and-open-files-with-encoding?view=vs-2022