Skip to content

Possible Regression in Code128 (GS1 FNC1) #223

@dmk2014

Description

@dmk2014

Hello,

We are using this library with great success for various symbologies - thanks very much for your work!

Description

We have run into an issue encoding GS1 data using the Code128 symbology in the latest version (3.1.5 at time of writing). The library uses Convert.ToChar(200) to represent FNC1 (or È). Sample data to encode (including both the leading FNC1 and an FNC1 after the variable length batch number application identifier): È10222333È15100701

Version 2.4.0:
Image

Version 3.1.5:
Image

From a brief review of the code it looks like the behaviour changed in 8c9d351 where the lookup tables were modified. Other characters are impacted in a similar way, but the relevant change for FNC1 was:

Before:
C128_Code.Rows.Add(new object[] { "102", FNC1, FNC1, FNC1, "11110101110" });

After:
entry(102, "FNC1", "FNC1", "FNC1", "11110101110");

Attempted Solution

Modified the lookup table entry as suggested in #179 to:
entry(FNC1.ToString(), FNC1.ToString(), FNC1.ToString(), "11110101110");

This results in:
Image

Summary

  • Am I correct in my assumption that this is a regression or was the change as intended?
  • The attempted solution above is somewhat naive
    • Has not been tested beyond basic encoding checks with the sample app
    • Unsure if it introduces side effects elsewhere in the encoding
    • Doesn't account for other changes to the lookup table (FNC2, FNC3, FNC4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions