rmcgibbo / slidedeck

Beautiful HTML5 slides in markdown. A easy-to-use fork of the google-io-2012 slide deck
317 stars 47 forks source link

UnicodeDecodeError #37

Closed Neverwozzer closed 9 years ago

Neverwozzer commented 9 years ago

Error precipitated by having "Perû" on slide instead of "Perú"

WIndows 7 64 bit. Do not know document encoding. Which document? slides.md - just a simple text document. Let me know how to see the encoding.

This error does not occur on a Mac (using French).

Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
   "__main__", fname, loader, pkg_name)
 File "C:\Python27\lib\runpy.py", line 72, in _run_code
   exec code in run_globals
 File "C:\Python27\Scripts\slidedeck.exe\__main__.py", line 9, in <module>
 File "C:\Python27\lib\site-packages\slidedeck\scripts\slidedeck.py", line 67, in main
   render.process_slides(args.markdown, args.output, args.template)
 File "C:\Python27\lib\site-packages\slidedeck\render.py", line 77, in process_slides
   md = codecs.open(markdown_fn, encoding='utf8').read()
 File "C:\Python27\lib\codecs.py", line 671, in read
   return self.reader.read(size)
 File "C:\Python27\lib\codecs.py", line 477, in read
   newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xfa in position 1385: invalid start byte
rmcgibbo commented 9 years ago

Thanks. I'll take a look at this at some point. In the mean time, you might also get a fix by using python3, because of the improved unicode handling, but i'm not sure.

mpharrigan commented 9 years ago

It is trying to open it as utf-8, but your editor is probably saving it as iso-8859-1 (aka latin-1). Save it as utf-8 (aka unicode). There is a dropdown in notepad -> save as

Neverwozzer commented 9 years ago

Thanks - saving it as UTF-8 solved the issue.