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

Weird encoding issue on Windows #49

Open
kotauskas opened this issue Mar 25, 2020 · 3 comments · May be fixed by #50
Open

Weird encoding issue on Windows #49

kotauskas opened this issue Mar 25, 2020 · 3 comments · May be fixed by #50

Comments

@kotauskas
Copy link

kotauskas commented Mar 25, 2020

The — (EM DASH) symbol in my doc comment got converted to gibberish from my current code page (cp1251). This might mean that the tool reads files in cp1251 but outputs them as UTF-8.

@kotauskas kotauskas changed the title Windows shell writes the output in the wrong encoding Weird encoding issue on Windows Mar 25, 2020
@udoprog
Copy link

udoprog commented Jun 11, 2020

Another interesting issue is that we seem to be getting an UTF-16 BOM:

image

This is from a README.md generated using cargo-readme on Windows.

@udoprog
Copy link

udoprog commented Jun 11, 2020

Note that this only happens when following the README and doing the following in PowerShell:

cargo readme > README.md

Might be an artifact of .NET using UTF-16 as an internal encoding and pipes being filtered through it.

Using the -o parameter like this gives the expected UTF-8 result.

cargo readme -o README.md

Could be worth adding a note to the README.

@kotauskas
Copy link
Author

Yeah, I opened a PR (#50) sometime before on this topic. I actually solved this the same way, by replacing > with an -o.

@kotauskas kotauskas linked a pull request Jun 12, 2020 that will close this issue
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 a pull request may close this issue.

2 participants