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
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
- Scene View with Debug Draw Mode enabled is gray when GPU Resident Drawer is enabled
- The UI is not visible when resizing out of focus built Player window with Application.runInBackground set to false
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