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

error: input contains invalid UTF-8 #7

Open
lizisepul opened this issue Sep 27, 2018 · 2 comments
Open

error: input contains invalid UTF-8 #7

lizisepul opened this issue Sep 27, 2018 · 2 comments

Comments

@lizisepul
Copy link

Hi,
I am adding spacy-cld as a component of a spacy pipeline. I am getting the following error with the string 'Con�anza'.

lib/python3.6/site-packages/spacy_cld/spacy_cld.py", line 20, in detect_languages\n _, _, results = detect(text.text)\npycld2.error: input contains invalid UTF-8 around byte 3 (of 8)\n']

The word looks like above when you print it.
print('Con�anza'.encode(encoding='utf-8'))
b'Con\x7fanza'

Thanks

@nickdavidhaynes
Copy link
Owner

@lizisepul hard to tell from your comment, but is the original string proper UTF-8? If not, CLD won't be able to handle it, and I'd recommend filtering out those characters before feeding to this package.

@fako
Copy link

fako commented Oct 23, 2018

One problem is that the pypi package still suffers from this issue: #1
Can the package receive an update? Or can you make a pre-release on Github? If the spaCy pipeline doesn't crash on unicode errors it's easier to handle these cases.

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

3 participants