Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 -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 -o doc.pdf
markdown2pdf: pandoc: 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
share|improve this question
NOTE: This problem does not exist in pandoc 1.6, but I'd like to stick to version from Ubuntu distribution (which is, still, – Alexander Gladysh Jul 24 '10 at 19:42
up vote 1 down vote accepted

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.