I am using ZBar with Python bindings. I ran into an issue where I can not properly decode UTF-8 encoded QR Codes.
For example, instead of 'Überscanner' = '\xc3\x9cberscanner' I get '\xef\xbe\x83\xef\xbd\xbcberscanner'
Can I somehow tell ZBar (or modify the code) so that it uses utf-8 or gives me the raw data? I could easily do proper decoding in Python.
Or is there a way to reverse encode it?
btw see this question/discussion on utf-8 in qr codes:
And in case you are interested: http://qr-code-scanner.com (maybe some of the scanners here use ZBar?)
not pretty but does the job….
utf8Data = symbol.data.decode("ascii")
utf8Data = symbol.data.decode("utf-8").encode("sjis")
note: I know only ascii or utf-8 goes in and the whole thing is only used for validation
I really think zbar should default to utf-8 even if it is against the spec. At least there should be an option. Even the google qr code api uses utf-8 as default encoding without a BOM - currently not readable with zbar.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.