Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandoc: Cannot decode byte '\xd0': Data.Text.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream

I'm getting this error when I made pandoc --filter pandoc-citeproc myfile.markdown myfile.pdf

pandoc: Cannot decode byte '\xd0': Data.Text.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream

I have searched here and here, but I have double checked from the text editor and my file is UTF-8 encoded. It has accented Spanish characters, but the same command worked without anyproblem in the past. Any pointers to a solution would be appreciated.

like image 920
Offray Avatar asked Feb 04 '14 18:02

Offray


2 Answers

My bad. The problem is related with the command I use to tell pandoc to create the pdf ouput. The proper command should be:

pandoc --filter pandoc-citeproc myfile.markdown -o myfile.pdf

note the -o flag between the input markdown file and the ouput pdf file. That's why I got the same utf-8 message that the people trying to convert from pdf to other formats documented in my links.

like image 62
Offray Avatar answered Sep 17 '22 21:09

Offray


Check JabRef encoding

In my case, I bumped into a similar error when converting Pandoc Markdown to XHTML. The culprit was a set of BibTeX citations which JabRef had encoded by default in ISO8859_1.

This default JabRef behaviour can be changed once and for all by setting Default encoding: to UTF8 in JabRef's Options > Preferences > General menu.

like image 24
Serge Stroobandt Avatar answered Sep 17 '22 21:09

Serge Stroobandt