encode to utf-8 before passing data to pandoc