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
Decoding a QR code containing a JSON string has extra characters on some devices #571
Comments
I'm not clear what you are using to encode or decode, whether it's even related to this project. You haven't given an example of the QR code |
@srowen My mistake. We are using the ZXing library for scanning QR codes in Android. In essence it's like this:
The |
You haven't shown evidence that the decoding is the problem. The QR code probably has the text it says it does, right? |
@srowen I'm not sure I follow. The output of the decoding varies from device to device when the input and the whole codebase remains the same. |
That's a function, likely, of the platform character set and how it renders the chars. The (?) chars mean unprintable. But they really are in the QR code, likely. |
@srowen They are not part of the QR code. |
You haven't posted any QR code, so I don't think we know that. It's the most likely explanation. Why not examine the code and encoder first? |
@srowen You can try any QR code generator and type the JSON I mentioned. |
Works OK for me: https://zxing.org/w/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=%7B%22foo%22%3A+%22bar%22%7D It's an issue with your code and how you're constructing text to display, or an issue with your encoder. This project's encoder/decoder appear to be fine. |
Does Zxing work only in Android? Do we need to conditionally check for other mobile OS's like iOS and Windows? |
We're working on a QR code scanner and so far it seems to work nicely. However, we noticed that on some devices, when scanning a valid QR code that contains valid JSON, the string has extraneous characters at the end. These characters appear only when scanning JSON QRs, though; when scanning a QR that contains some other text (e.g. ("Hello, world").
So, for example when scanning a QR code that contains this JSON:
The result on Nexus 6P is the same, where as the result with LG G3 is:
(The characters are not actually at-signs; they look like those though. I can't copypaste the actual results at the moment.)
What could cause this?
The text was updated successfully, but these errors were encountered: