Skip to content
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

Templates: Defined Encoding #67

Open
FriedrichWeinmann opened this issue Oct 20, 2018 · 4 comments
Open

Templates: Defined Encoding #67

FriedrichWeinmann opened this issue Oct 20, 2018 · 4 comments

Comments

@FriedrichWeinmann
Copy link
Member

  • Explicitly specify output encoding
  • Include encoding information in file
  • Override template provided encoding
@Splaxi
Copy link
Contributor

Splaxi commented Oct 23, 2018

Would that fix my issue with Invoke-PSMDTemplate CommandTest that doesn't give me the same encoding like Set-PSMDEncoding?

I run Set-PSMDEncoding against all my ps1 files, this includes my pester test files. When I afterwards want to update the pester file, the encoding is changed.

@FriedrichWeinmann
Copy link
Member Author

Heya,

it will fix files emitted by Invoke-PSMDTemplate from being the wrong encoding.
Given your description however, I'm assuming you have a case of VS Code changing your formatting on save. This would be something you can fix in your editor, by changing the default encoding.

Either way, updating the editor settings and this update combined will lead you to never having to worry about encoding issues for your projects.

@Splaxi
Copy link
Contributor

Splaxi commented Oct 23, 2018

And the default encoding should be UTF 8 BOM?

@FriedrichWeinmann
Copy link
Member Author

Indeed. UTF8 for widest compatibility and the closest we have for a standard.
BOM so we know rather than assume the encoding of a file

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

No branches or pull requests

2 participants