-
Notifications
You must be signed in to change notification settings - Fork 523
Closed
Labels
Area-ConfigurationFeature: VS CodeRequest to use or implement a VS Code feature.Request to use or implement a VS Code feature.Issue-EnhancementA feature request (enhancement).A feature request (enhancement).Resolution-AnsweredWill close automatically.Will close automatically.
Description
Summary of the new feature
- VSCode creates UTF-8 files without BOM by default.
- This causes Windows PowerShell (but not PowerShell Core) to misinterpret any non-ASCII-range characters, because, in the absence of a BOM, it defaults to the system's legacy "ANSI" code page (e.g., Windows-1252).
It seems that this has been a perennial pain point (whose root cause isn't obvious), as evidenced by, for instance, by #629 or this StackOverflow question.
Making the extension default all new PowerShell files to UTF-8 with BOM solves that problem.
Such files would be both cross-edition and cross-platform compatible (given that PowerShell Core still correctly interprets the BOM, even though it doesn't require it).
Proposed technical implementation details
I don't know how it works in the context of extension-specific settings, but in the general settings.json file you can simply add the following:
"[powershell]": {
"files.encoding": "utf8bom"
}Metadata
Metadata
Assignees
Labels
Area-ConfigurationFeature: VS CodeRequest to use or implement a VS Code feature.Request to use or implement a VS Code feature.Issue-EnhancementA feature request (enhancement).A feature request (enhancement).Resolution-AnsweredWill close automatically.Will close automatically.