Skip to content

Add a doc about encoding configuration #1761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Feb 16, 2019

PR Summary

Adds a document that deals with configuring encoding in VSCode and PowerShell so that there are no nasty surprises.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Feb 16, 2019

This should go on PowerShell-Docs instead I think. Can you move it there before we get too many comments?

@@ -0,0 +1,327 @@
# Configuring VSCode and PowerShell to prevent encoding bugs
Copy link
Contributor

@rkeithhill rkeithhill Feb 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to both Windows PowerShell and PowerShell Core? I thought PowerShell Core was immune from this issue? If so, maybe this should say "Windows PowerShell"? OK, it appears that pwsh on Windows doesn't use utf-8 (no BOM). But pwsh on Linux, and presumably macOS, do use utf-8. So maybe this should be "to prevent encoding bugs on Windows"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, the above was clarified after reading the rest of the doc.

and set the `"files.encoding"` setting:

```json
"files.encoding": "utf8bom"
Copy link
Contributor

@rkeithhill rkeithhill Feb 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth pointing out that you can make this encoding change just for PoweShell files:

    "[powershell]": {
        "files.encoding": "utf8bom"
    }

Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstandind! Only one little comment on how to make the VSCode file encoding setting be specific to PowerShell files.

@rjmholt rjmholt requested a review from JamesWTruher February 19, 2019 17:29
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc brought tears to my eyes it was so good. LGTM. Just people move it to the other repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants