some-programs / exitwp

Exitwp is tool primarily aimed for making migration from one or more wordpress blogs to the jekyll blog engine as easy as possible.
686 stars 145 forks source link

Fixes crash when trying to print spanish accented characters. #47

Closed Goles closed 11 years ago

Goles commented 11 years ago
    Traceback (most recent call last):
      File "./exitwp.py", line 353, in <module>
        data = parse_wp_xml(wpe)
      File "./exitwp.py", line 164, in parse_wp_xml
        'items': parse_items(),
      File "./exitwp.py", line 127, in parse_items
        body = gi('content:encoded')
      File "./exitwp.py", line 120, in gi
        print result

    UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 236: ordinal not in range(128)

Now is will display an encoding error on the writing of the files (not resulting on a crash anymore).

writing............................................................................................
 Parse error on: Blog post title where the error happens
.................................

This fix could still be improved to fix the writing but don't really have the time right now.

thomasf commented 11 years ago

thanks