Skip to content

barcode scan -> code 128B and code 128C scan raw value has an additional characterΒ #348

Closed

Description

@brsgina

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:
image

I used this site for barcode generation: http://www.barcodegenerator.online/

Activity

  1. zhouyiself commented on Sep 3, 2021

    @zhouyiself
    Contributor

    I tried one generated from that site and it works fine. Can you share a sample image that didn't work for you?

  2. brsgina commented on Sep 6, 2021

    @brsgina
    Author

    Of course!

    So i generated this barcode first with the selection: CODE 128
    image

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

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

    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):
    image

  3. zhouyiself commented on Sep 29, 2021

    @zhouyiself
    Contributor

    Hi, the last character is part of the payload (group separator ascii 29), added by the generator.

  4. brsgina commented on Sep 29, 2021

    @brsgina
    Author

    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:
    image

    And when I scan the barcode:
    image
    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
    image
    And when I scan it:
    image

    But with my other code, there is no additional char with this generator either:
    image
    image

    Even KGMIK000073 works fine.

  5. helsq commented on Oct 15, 2021

    @helsq

    @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
    1

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

    FNC1 can be returned in several cases (see GS1-128) but not when FNC1 is a checksum

  6. lk7630 commented on Nov 5, 2021

    @lk7630

    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: image

    I used this site for barcode generation: http://www.barcodegenerator.online/

    Don't know if this is gonna help but if you use getRawValue() you can use getDisplayValue instead

  7. zhouyiself commented on Dec 7, 2021

    @zhouyiself
    Contributor

    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.

  8. jswolf19 commented on Mar 5, 2022

    @jswolf19

    Upgrading to 17.0.2 fixed this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions