-
Notifications
You must be signed in to change notification settings - Fork 20
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 problems when include cyrillic files #2
Comments
It seems that |
Can confirm with Windows 10 and pandoc 1.16.0.2 (pandoc and pandoc-include built on the machine using stack). As another data point for hunting down this bug: Take a file containing the umlauts of a, o, and u (LATIN SMALL LETTER A WITH DIAERESIS etc.) bug.markdown
Run it in cmd as
and you get the expected: ä ö ü Even if you run it as
you get the expected output. However, if you run it as
where incl.markdown only includes bug.markdown, you get messed-up characters. |
Hi @russtone, @LarsEKrueger, thank you for your patience and the detailed issue. On a new branch I've made it possible to set the encoding to UTF-8, will this help in your case? To use, simply add
|
Can't test the branch right now. Might take a few days until I find the time. However, I don't understand why you want to make a difference in the encoding of the file that does the include and the one that is included. Pandoc is UTF-8 on input and there's no way around it. One would expect that include files are UTF-8 too, without requesting them to be. If there's a relevant use case that I don't see right now, you definitely need to document that. |
@LarsEKrueger This makes it even easier, thank you! |
Tried commit 53b0d1 on Windows 10 (with Creator's Update). Pandoc and pandoc-include compiled using stack and ghc 8. Issue is still there. |
Thank you for checking. Unfortunately I have no other idea what could be wrong. |
Oh, I see. That commit is old, and does not contain the fixes. Please try the latest on the fixing branch: 913ca87 . Thanks! |
Still doesn't work. Could it be that the I use the following code in my filter and it does work on windows.
If I use your
Your variable |
Thank you, you are awesome. I've updated the branch, and really hope this will solve the bug. |
After removing the utf8 class from the (cd test/encoding/ ; pandoc -f markdown -t html -s -o test.html --filter ../../dist/dist-sandbox-1d3e9dda/build/pandoc-include/pandoc-include test.md) I encountered this problem too when writing justReadFile (see previous comment). I fixed it by moving the readMarkdown inside the function. Same error happens on Windows. |
* steindani/issueFixes: Revise fileContentAsString encoding (issue steindani#2) Include only a portion of a file (issue steindani#8) Refactoring, file contents read as UTF-8 Use UTF-8 if requested (issue steindani#2) CodeBlock include and file reader changes
Steps to reproduce:
test.md
include.md
And result will be:
The text was updated successfully, but these errors were encountered: