You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
barcode scan -> code 128B and code 128C scan raw value has an additional characterΒ #348
When I read a code128 or code128A format barcode using mlkit barcode scanner in my app in Android Studio , everything is fine. But when I read a code128B or code128C format barcode, it reads the raw value with an additional character, this:
So i generated this barcode first with the selection: CODE 128
And I scanned this file with my android app, I printed out the raw value:
After, I generated the same barcode, but with the selection of Code128B
I scanned that barcode too, and the raw value is the same, but with one char addition (this char is seen only in the log, when I write out in a textview, it is not there):
@zhouyiself, group separator ascii 29 is not a part of the payload in this case. ascii 29 (FNC1) in this case is a checksum. I have the same issue. If a checksum equals 29 (FNC1) ml kit returns a char 29 in a raw value.
For example.
Barcode B12326, checksum equals 86 (SYN) raw value B12326
Barcode B12328, checksum equals 29 (FNC1) raw value B12326[char with ascii code 29]
FNC1 can be returned in several cases (see GS1-128) but not when FNC1 is a checksum
When I read a code128 or code128A format barcode using mlkit barcode scanner in my app in Android Studio , everything is fine. But when I read a code128B or code128C format barcode, it reads the raw value with an additional character, this:
Activity
zhouyiself commentedon Sep 3, 2021
I tried one generated from that site and it works fine. Can you share a sample image that didn't work for you?
brsgina commentedon Sep 6, 2021
Of course!
So i generated this barcode first with the selection: CODE 128

And I scanned this file with my android app, I printed out the raw value:

After, I generated the same barcode, but with the selection of Code128B

I scanned that barcode too, and the raw value is the same, but with one char addition (this char is seen only in the log, when I write out in a textview, it is not there):

zhouyiself commentedon Sep 29, 2021
Hi, the last character is part of the payload (group separator ascii 29), added by the generator.
brsgina commentedon Sep 29, 2021
I thought the same thing, but I tried it with different generator and all generator did the same, but only with that code: KGMIK000072
For example with another code:

And when I scan the barcode:

So there is no additional char in this time.
Let's see another online generator: http://generator.onbarcode.com/online-code-128-barcode-generator.aspx


And when I scan it:
But with my other code, there is no additional char with this generator either:


Even KGMIK000073 works fine.
helsq commentedon Oct 15, 2021
@zhouyiself, group separator ascii 29 is not a part of the payload in this case. ascii 29 (FNC1) in this case is a checksum. I have the same issue. If a checksum equals 29 (FNC1) ml kit returns a char 29 in a raw value.
For example.

Barcode B12326, checksum equals 86 (SYN) raw value B12326
Barcode B12328, checksum equals 29 (FNC1) raw value B12326[char with ascii code 29]

FNC1 can be returned in several cases (see GS1-128) but not when FNC1 is a checksum
lk7630 commentedon Nov 5, 2021
Don't know if this is gonna help but if you use getRawValue() you can use getDisplayValue instead
zhouyiself commentedon Dec 7, 2021
Updates: we have fixed this issue internally and the fix will be in our future release that is scheduled to be available at late January 2022.
upgraded android to mlkit17.0.2
upgraded android to mlkit17.0.2
jswolf19 commentedon Mar 5, 2022
Upgrading to 17.0.2 fixed this issue for me.