-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Windows: Invalid UTF-8 stream when using Pandoc as a filter #3208
Comments
Can someone else who uses pandoc on Windows try to confirm |
I can reproduce it, but TBH there are workarounds:
See this thread for more details. Now, I wouldn't be surprised if there are bugs in citeproc or other programs that eat from stdin, as early on I also had some troubles with this and panflute (workaround). It seems that you need to specify you want to use a utf8 encoding, or else some other encoding might be used, which could corrupt the input. |
Ok, thanks for your responses and for the tip. This is not a big problem. Just a remark: In a powershell console, $outputencoding=[console]::outputencoding=[text.encoding]::utf8 and allows to do such things: "Gérard"|pandoc
or $a, $b, $c = "Manger équilibré", "pâtes", "râpé"
@"
# $a
## Les $b
Faites cuire 8 minutes les $b dans deux volumes d'eau. Servez les $b avec du fromage *$c*
"@|pandoc
|
Nothing to change in pandoc, correct? |
I'm not able to answer this question. |
It seems to me that you have the solution above: if you set the console encoding to UTF-8 using
then it works, correct? Pandoc documents that it expects all input, and gives all output, in UTF-8. And it seems that the issue was that your console was not set up by default this way. But perhaps I've misunderstood, because you say "I've not found a solution." |
In a powershell console, $outputencoding=[console]::outputencoding=[text.encoding]::utf8
"é"|pandoc works fine but $outputencoding=[console]::outputencoding=[text.encoding]::utf8
pandoc
é outputs (after ctrl+z and Enter)
In the standard command prompt chcp 65001
echo é | pandoc works, but chcp 65001
pandoc
é doesn't work. |
I see your point:
In this case, pandoc exits silently after reading a non-ascii character PS: These one liners sets cmd and PowerShell to use UTF8 by default, in case it's useful |
I understand the issue now, but I can't see anything in |
Thanks for your replies. 1[console]::inputencoding=[text.encoding]::ascii
$outputencoding=[console]::outputencoding=[text.encoding]::utf8
pandoc
a
é output:
2 (doesn't work)$outputencoding=[console]::outputencoding=[console]::inputencoding=[text.encoding]::utf8
pandoc
a
é output: (without Ctrl-Z) <p>a</p> |
Closing this, since it looks like an issue with the windows console, not pandoc. |
Hi,
I'm using Pandoc 1.17.2 on Windows 10.
When using pandoc as a filter (giving a string with accent as input)
it displays
I get the expected output on the terminal if I put the text in a UTF-8 encoded file
essai.txt
and use in a Powershell consoleI've made some attempts. For example, inserting
before
displays a blank output when we finish the first line by pressing the key enter.
The text was updated successfully, but these errors were encountered: