tbfisher / sublimetext-Pandoc

A Sublime Text plugin that uses Pandoc to convert text from one markup format into another. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to XHTML, HTML5, HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides, Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, EPUB version 2 or 3, FictionBook2, DocBook, GNU TexInfo, Groff man pages, Haddock markup, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.
MIT License
136 stars 26 forks source link

Encoding error of result #3

Closed dozed closed 11 years ago

dozed commented 11 years ago

I get an error with the result encoding under Windows:

Traceback (most recent call last):
  File ".\Pandoc.py", line 88, in transform
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 487: ordinal not in range(128)

The fix is to encode the result as UTF-8:

view.replace(edit, region, result.decode('utf8'))
despairblue commented 11 years ago

+1

dozed commented 11 years ago

Sent a pull request: https://github.com/tbfisher/sublimetext-Pandoc/pull/4