-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
bug: Can't detect QR Codes with charset other than UTF-8 #241
Labels
Comments
Thanks, I will fix this. |
@falu-edo Please give this dev version a try and let me know if it works now:
|
Hi @robingenz thank you very much! It works now. Do you have any idea when this fix is rolled out in a new version of this library? |
I plan to publish a new release by the end of the week. However, you can just use the pre-release for now. |
robingenz
added a commit
that referenced
this issue
Feb 4, 2025
* feat(barcode-scanning): return the raw bytes of a barcodes Close #241 * fix: handle `null` values * docs [skip ci] * wip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plugin(s)
Version
6.1.0
Platform(s)
Current behavior
When I want to scan a QR Code which was not encoded with UTF-8 it doesn't detect it. So neither an error nor a success message occurs.
Expected behavior
The QR-Code gets detected in other charsets like ISO-8859-1.
Reproduction
https://nextcloud.benluescher.ch/s/BD8PbboyMcL8YLw
Steps to reproduce
Other information
I found following Code in BarcodeScanner.java:
String rawValue = barcode.getRawValue();
I checked the MLKit page and they state: "It's only available when the barcode is encoded in the UTF-8 format, and for non-UTF8 ones use getRawBytes() instead."
So when I replace the before mentioned code with:
String rawValue = new String(barcode.getRawBytes(), StandardCharsets.UTF_8);
the QR code gets detected.
Capacitor doctor
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/cli: 6.2.0
@capacitor/core: 6.2.0
@capacitor/android: 6.2.0
@capacitor/ios: 6.2.0
Before submitting
The text was updated successfully, but these errors were encountered: