Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode error #5

Open
az0 opened this issue Jan 9, 2015 · 0 comments
Open

Unicode error #5

az0 opened this issue Jan 9, 2015 · 0 comments

Comments

@az0
Copy link

az0 commented Jan 9, 2015

Shouldn't this work?

>>> Readability(u'This does not work\u2762').SMOGIndex()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "readability\readability.py", line 16, in __init__
    self.analyze_text(text)
  File "readability\readability.py", line 20, in analyze_text
    char_count = get_char_count(words)
  File "readability\utils.py", line 17, in get_char_count
    characters += len(word.decode("utf-8"))
  File "c:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2762' in position 4: ordinal not in range(128)

P.S., thank you for the nice code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant