Skip to content
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

GS1-128 FNC1 special char throws exception #179

Open
gustafcarleson opened this issue Oct 31, 2023 · 0 comments
Open

GS1-128 FNC1 special char throws exception #179

gustafcarleson opened this issue Oct 31, 2023 · 0 comments

Comments

@gustafcarleson
Copy link

Hi, thank you for this software and your work.

When upgrading from 2.4.0 to 3.0.2 our setup for creating GS1-128 stopped working.

We prepend the FNC1 char 200 (È) to our data.

var dataToEncode = Convert.ToChar(200).ToString() + ApplicationIdentifier + Data;
var image = barcode.Encode(BarcodeStandard.Type.Code128, dataToEncode, width, height)

This however, now results in the following exception:

System.Exception: 'EC128-3: Could not insert start and code characters.
Message: EC128-2: Could not determine start character.'

Something has changed in the way that the encodings are retrieved and if I insert the following changes it works

var dataToEncode = Convert.ToChar(200).ToString() + ApplicationIdentifier + Data;
var image = barcode.Encode(BarcodeStandard.Type.Code128C, dataToEncode, width, height) // Note the "C" in Code128C

Code128.cs, line 175:

entry("FNC1", "FNC1", FNC1.ToString(), "11110101110"); // Note the addition ToString() which will add char 200 (È) to the C part of the lookup table

I did not find any documentation, example or test that sheds light on this so please let me know if I should do anything different.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant