Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
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, 1.5.1.1). –  Alexander Gladysh Jul 24 '10 at 19:42

1 Answer 1

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

 
discard

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.