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

Encoding Windows-1252 not supported #21

Closed
krusch opened this issue Sep 10, 2015 · 6 comments
Closed

Encoding Windows-1252 not supported #21

krusch opened this issue Sep 10, 2015 · 6 comments

Comments

@krusch
Copy link

krusch commented Sep 10, 2015

Some INI files seem to use Windows-1252 encoding (e.g. mdash as x97), which is not a support output encoding.

@lipkau
Copy link
Owner

lipkau commented Sep 12, 2015

Thank you for reporting this. I will investigate the issue.

But if this is a limitation of Add-Content CmdLet I will not be able to do much about it.

@craibuc
Copy link
Collaborator

craibuc commented Sep 12, 2015

It's fairly easy to change a file's encoding. See my answer.

@krusch
Copy link
Author

krusch commented Sep 13, 2015

@craibuc This is about the encoding of files written by PsIni modules, not about the encoding in the Git repository.

@craibuc
Copy link
Collaborator

craibuc commented Sep 13, 2015

Yes, I understand that. I was simply demonstrating a technique to change a
file's encoding.

On Sun, Sep 13, 2015 at 9:00 AM, Klaus Johannes Rusch <
notifications@github.com> wrote:

@craibuc https://github.com/craibuc This is about the encoding of files
written by PsIni modules, not about the encoding in the Git repository.


Reply to this email directly or view it on GitHub
#21 (comment).

@krusch
Copy link
Author

krusch commented Sep 14, 2015

@craibuc thanks, found the magic line on rereading the post. Unfortunately Set-Content
relies on Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding, which does not seem to support Windows-1252, valid values are String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, Ascii.

@lipkau
Copy link
Owner

lipkau commented Sep 15, 2015

As correctly stated, Add-Content is restricts the possible encoding formats to Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding (as state in the documentation).

This The Official Scripting Guys Forum! question addresses this issue.

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

3 participants