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

Add support for GS-1 encoding via the FCN1 character #10

Merged
merged 1 commit into from
Mar 24, 2018

Conversation

mungewell
Copy link
Contributor

@mungewell mungewell commented Mar 24, 2018

This patch adds the ability to encode GS-1 barcodes using the FNC1
character, which is defined by the new property 'DmtxPropFnc1' and
defaulted to 'DmtxUndefined'. Once set, the specified character
within the text of the barcode will be replaced with FNC1.

GS-1 encoding is valid for all barcode encodings, however FNC1 is
only valid for ASCII and C40/Text. Code will automatically escape to
ASCII where needed and is transparent for user.

An additional patch for dmtxutils is provided, using the command line
parameter '-G xx' allows user to specify the character they wish to
use/replace for FNC1.

Example use - '+' will be replaced FNC1:
$ echo -n '+0010030378123456789017130700103033262+3000017' | dmtxwrite -o test.png -G 43

and decoding replacing FNC1 with '*' (for validation):

$ dmtxread test.png -G 42
*0010030378123456789017130700103033262*3000017

Note: FNC1 is implied at the end of fixed length AI's, so is only
required to mark end of variable length AI's.

This patch adds the ability to encode GS-1 barcodes using the FNC1
character, which is defined by the new property 'DmtxPropFnc1' and
defaulted to 'DmtxUndefined'. Once set, the specified character
within the text of the barcode will be replaced with FNC1.

GS-1 encoding is valid for all barcode encodings, however FNC1 is
only valid for ASCII and C40/Text. Code will automatically escape to
ASCII where needed and is transparent for user.

An additional patch for dmtxutils is provided, using the command line
parameter '-G xx' allows user to specify the character they wish to
use/replace for FNC1.

Example use - '+' will be replaced FNC1:
$ echo -n '+0010030378123456789017130700103033262+3000017' | dmtxwrite -o test.png -G 43

and decoding replacing FNC1 with '*' (for validation):
$ dmtxread test.png -G 42
*0010030378123456789017130700103033262*3000017

Note: FNC1 is implied at the end of fixed length AI's, so is only
required to mark end of variable length AI's.
@msva msva merged commit eab8237 into dmtx:master Mar 24, 2018
sh4dowb added a commit to sh4dowb/pylibdmtx that referenced this pull request Aug 3, 2023
dmtx/libdmtx#10

Simply pushing \x1d will result in ASCII RS codeword (030) instead of actual FNC1 codeword (232), this commit allows GS1 encoding.

`fnc1=29` can be used to substitute \x1d
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

Successfully merging this pull request may close these issues.

2 participants