1

I'm trying to generate documentation pdf file with pandoc's markdown2pdf. My source file contains some cyrillic UTF-8 symbols. My system locale is en_US.UTF-8.

When run in default locale, markdown2pdf fails to load document:

$ markdown2pdf doc.md -o doc.pdf

markdown2pdf: /tmp/pandoc/doc.log: hGetContents: invalid argument (Invalid or incomplete multibyte or wide character)

If I set LANG=ru_RU.UTF-8, markdown2pdf loads document fine, launches pandoc and pandoc breaks (note different error text):

$ LANG=ru_RU.UTF-8 markdown2pdf doc.md -o doc.pdf
markdown2pdf: pandoc: doc.md: hGetContents: invalid argument (Invalid or incomplete multibyte or wide character)

I do not want to change my system locale. How can I fix this issue?

System information:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 10.04.1 LTS
Release:    10.04
Codename:   lucid

$ uname -a
Linux localhost 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux

$ pandoc --version
pandoc 1.5.1.1
Alexander Gladysh
  • 2,343
  • 7
  • 30
  • 47

1 Answers1

1

I had to manually upgrade to pandoc 1.6 which fixes this bug:

  # Install and update cabal (Haskell's package manager)
  sudo apt-get install cabal
  cabal update
  cabal install cabal-install
  # Put cabal's executables to path
  echo "PATH=${PATH}:${HOME}/.cabal/bin" >> ${HOME}/.bashrc
  source ${HOME}/.bashrc
  # Reset bash's path cache
  hash -r

  cabal install -fhighlighting pandoc
Alexander Gladysh
  • 2,343
  • 7
  • 30
  • 47