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

Fix encoding corruptions #43

Merged
merged 4 commits into from
Nov 11, 2020
Merged

Fix encoding corruptions #43

merged 4 commits into from
Nov 11, 2020

Conversation

fmang
Copy link
Contributor

@fmang fmang commented Oct 28, 2020

When running a simple echo é through winrm-elevated, the output I get back is badly corrupted. There are actually two corruptions:

  1. We upload the script to execute as a UTF-8 file, but Windows reads it as ANSI because that’s its default encoding.
  2. When cmd.exe writes the output files, its default encoding is OEM, but PowerShell reads them later as ANSI.

Adding a BOM to the beginning of the input script fixes 1, and explicity telling PowerShell to use the OEM encoding when reading the output file fixes 2.

Characters not representable as ANSI or OEM are transliterated.

@fmang fmang mentioned this pull request Oct 28, 2020
@mwrock mwrock merged commit c1e78fe into WinRb:master Nov 11, 2020
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.

2 participants