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 in reading empty serials #9

Open
m-planck opened this issue Jan 15, 2014 · 0 comments
Open

Error in reading empty serials #9

m-planck opened this issue Jan 15, 2014 · 0 comments

Comments

@m-planck
Copy link

Hidapi responds to empty serial numbers with a unicode charakter u'\u0409'.
This gives an error on ASCII terminals or on Windows with different codepages:
" return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u0409' in position
16: character maps to

The serial number field is explicitly declared in hid.c as unicode type for no apparent reason. Other fields like manufacturer, product etc are declared as normal strings, so there is no error.

Used system: Win7 x64
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win

import sys
sys.stdout.encoding
'cp850'

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