How does pydtmx or libdtmx return the FNC1 character

Question:

Does anyone know what character FNC1 returns as in pydmtx? I’m using pydmtx to read a variety of Datamatrix tags which include variable length elements that I need to parse. Pydmtx is a wrapper for libdmtx, The changelog for libdmtx 0.7.0 says it added reader supports for FNC1. I’d really like to do something like this:

def split_tag(tag_string):    
    FNC1="u{what_I'm_looking_for}" 
    return string.split(tag_string, FNC1)

Yes, I understand tag elements will include prefixes and fixed length tags will not have a FNC1 between them and will have to be handled separately in my parser.

Alternately if there’s a good python opensource library that reads and parses DataMatrix you’ll save me about half a day on this module.

Asked By: Empiricist

||

Answers:

Okay this solved it for me. Pydmtx returns FNC1 as “x1d” aka information separator 3

Answered By: Empiricist

The GS1 Application Standards for every GS1-specialised barcode symbology (including GS1 DataMatrix) specify that FNC1 characters that are used in a field separator role must be decoded as ASCII 29 (GS). Be aware that there are other roles for FNC1 characters in such symbols that are treated differently which this answer explains.

The “extraction” part of this answer explains how to properly parse GS1-formatted data.

Answered By: Terry Burton

I’m trying to use pylibdmtx to decode data matrix code from image and faced with problem of geeting raw data string containing symbols.

Could you please explain how to read string with original set of characters of dm-code

Answered By: Nikita Dvoretskii
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.