-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Barcode doesn't provide rawData as a byte array!~ #156
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
Comments
Yep, I've got a similar use-case with custom aztec codes. Like @815vojta said it would be helpful to provide the raw bytes instead of an error message. |
Thanks for the feedback. Unfortunately, there is no way to obtain the raw bytes without adding a new byte[] field since Java requires that Strings contain valid UTF-16. Right now your best option, if you control both the sender and receiver, is to encode your data in a supported character set (e.g. ISO-8859-1). |
Well, the problem is ISO-8859-1 doesn't work. Please, see the related
Stack Overflow question, there you can see my QR code of mode "byte"
encoded using ISO-8859-1, which is valid, but unreadable using this
Library. All I get is "Unknown encoding" in both rawValue and
displayValue, because the byte array wasn't a valid UTF-8 string.
However, the default encoding for QR codes should be ISO-8859-1, not UTF-8.
Vojta
Dne 30.11.2016 v 16:26 pchx napsal(a):
…
Thanks for the feedback.
Unfortunately, there is no way to obtain the raw bytes without adding
a new byte[] field since Java requires that Strings contain valid
UTF-16. Right now your best option, if you control both the sender and
receiver, is to encode your data in a supported character set (e.g.
ISO-8859-1).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#156 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWo17T0T7PCdTaxTibyjjgoW-7ZGPsIgks5rDZWbgaJpZM4K8Sm4>.
|
Is there any progress on this topic? Why couldn't you just add a new byte[] field? Could you please have a look why this code cannot be decoded? |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
1 similar comment
+1 |
+1 This is a rather large limitation that needs to be addressed. |
+1 |
I use
com.google.android.gms.vision.barcode.BarcodeDetector
in order to read QR codes. The problem is these codes carry raw binary data; no phone numbers, no URLs, no geopoints... I cannot change these QR codes, because they are generated in a different application.When I scan these QR codes using Android Barcode API, the resulting
Barcode
object doesn't allow me to access the raw data, although it must know it!All I get is
"Unknown encoding"
message both inrawValue
anddisplayValue
properties.Having a
byte[]
property instead of twoString
properties would make more sense, since QR codes can carry general data.I don't see the point of hiding raw data byte array from developers. Could I somehow extend the
BarcodeDetector
class or theBarcode
class to get what I need?Thanks a lot!
Related Stack Overflow question
The text was updated successfully, but these errors were encountered: