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
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
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