You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1504,7 +1504,8 @@ Options (`eclevel`, `version`, `parse`, etc.) are passed separately as
1504
1504
These are typical roles. Symbologies routinely overload them with non-typical
1505
1505
or even inverted semantics, so always consult the target spec.
1506
1506
1507
-
-**FNC1**: behaviour is defined by the barcode symbology spec strictly by *position*, without conferring meaning. **First position**: the reader sets a particular symbology-identifier modifier value. **Second position**: the reader sets a different modifier value. **Third+ position**: the reader transmits as GS (0x1D). What those positions *mean* (e.g. "GS1 AI formatted data", "AIM-denoted industry formatting", "field separator") is layered on by separate standards — GS1 General Specifications and AIM-denoted formatting standards — which the symbology spec does not reference and does not need to.
1507
+
-**FNC1**: behaviour is defined by the barcode symbology spec strictly by *position*, without conferring meaning. **First position**: the reader sets a particular symbology-identifier modifier value. **Second position**: the reader sets a different modifier value.
1508
+
**Third+ position**: the reader transmits as GS (0x1D). What those positions *mean* (e.g. "GS1 AI formatted data", "AIM-denoted industry formatting", "field separator") is layered on by separate standards — GS1 General Specifications and AIM-denoted formatting standards — which the symbology spec does not reference and does not need to.
1508
1509
-**FNC2**: Structured Append flag (a.k.a. Message Append) — multiple physical symbols carry one logical message, reassembled by the reader into a single read.
1509
1510
-**FNC3**: reader programming flag — present anywhere in the symbol, instructs the reader to enter device configuration mode rather than transmit.
1510
1511
-**FNC4**: extended ASCII for 7-bit-native symbologies — a single FNC4 shifts the next character to lift its value from 0-127 into 128-255; two consecutive FNC4s latch the lift for subsequent characters.
@@ -1532,8 +1533,10 @@ Per the symbology spec, the symbol's codewords / bitstream are a sequence drawn
1532
1533
-**Mode-change codewords**. The mechanism varies by symbology:
1533
1534
-**State machine** (Code 128, Data Matrix, Aztec, PDF417, MaxiCode, DotCode, Code 93, etc. — the prevalent approach): shift codewords (next character only) and latch codewords (subsequent characters until reset) are interleaved with data; the current mode is implicit, initialised per the symbology default and updated as shifts/latches are encountered.
1534
1535
-**TLV segments** (QR Code, Micro QR, rMQR, Han Xin Code): each contiguous block of one-mode data is bracketed by an explicit mode indicator + (where applicable) length count, followed (optionally) by a mode terminator.
1535
-
-**Encodings of non-data signals**, *each symbology- and mode-specific*. The encoded bit pattern for an in-data FNC1 (third+ position) depends on which compaction mode is active *and* whether FNC1-in-first is set. Examples: Han Xin uses the numeric extension `1111101000`; QR alphanumeric under FNC1-in-first uses `%` (with literal `%` doubled to `%%`); QR byte under FNC1-in-first uses the GS character (0x1D); Data Matrix and Aztec use dedicated codewords. Never assume an FNC1 in input becomes a particular byte in the symbol — the bit pattern depends on both the symbology and the active mode.
1536
-
-**Macros / envelope codewords** have **global effect**: a single codeword in the symbol expands at the reader into a multi-byte envelope wrapping the entire decoded message. For example, Data Matrix codeword 236 invokes Macro 05 — at the reader the byte stream sent to the host becomes `[)>` + RS + `05` + GS + [decoded data] + RS + EOT (9 envelope bytes for 1 codeword). Codeword 237 (Macro 06) is similar with `06`. The encoder emits one codeword; the reader produces the envelope; the host sees bytes added to both ends of the message that the encoder never explicitly wrote.
1536
+
-**Encodings of non-data signals**, *each symbology- and mode-specific*. The encoded bit pattern for an in-data FNC1 (third+ position) depends on which compaction mode is active *and* whether FNC1-in-first is set.
1537
+
Examples: Han Xin uses the numeric extension `1111101000`; QR alphanumeric under FNC1-in-first uses `%` (with literal `%` doubled to `%%`); QR byte under FNC1-in-first uses the GS character (0x1D); Data Matrix and Aztec use dedicated codewords. Never assume an FNC1 in input becomes a particular byte in the symbol — the bit pattern depends on both the symbology and the active mode.
1538
+
-**Macros / envelope codewords** have **global effect**: a single codeword in the symbol expands at the reader into a multi-byte envelope wrapping the entire decoded message. For example, Data Matrix codeword 236 invokes Macro 05 — at the reader the byte stream sent to the host becomes `[)>` + RS + `05` + GS + [decoded data] + RS + EOT (9 envelope bytes for 1 codeword).
1539
+
Codeword 237 (Macro 06) is similar with `06`. The encoder emits one codeword; the reader produces the envelope; the host sees bytes added to both ends of the message that the encoder never explicitly wrote.
1537
1540
-**Padding**, **ECC**, structural fixed patterns; termination via specific codeword values, padding sequences, or (in TLV-style symbologies) a dedicated mode-terminator codeword.
1538
1541
1539
1542
**Modes are a compaction strategy, not semantic signalling.** Whether a byte
@@ -1578,7 +1581,8 @@ The host receives:
1578
1581
1579
1582
-**AIM Symbology Identifier prefix**`]Xn`. `X` is the symbology code (e.g. `Q` QR, `d` Data Matrix, `h` Han Xin, `c` Code 128); `n` is a symbology-specific modifier signalling features observed during decode (`]Q1` ECI, `]Q3` GS1, `]h2` GS1, `]h4` URI, etc.).
1580
1583
-**A flat byte stream**, with reader-applied transformations:
1581
-
- FNC1 in third+ position → GS (0x1D) at the host, regardless of how the symbology encoded it. (Per the symbology spec; the symbology spec confers no meaning on this beyond the positional rule. GS1 GenSpec layers the "element separator" interpretation on top.) The reader applies the inverse transformation per the active compaction mode — e.g. in QR alphanumeric under FNC1-in-first, single `%` decodes to GS while doubled `%%` decodes to literal `%`.
1584
+
- FNC1 in third+ position → GS (0x1D) at the host, regardless of how the symbology encoded it. (Per the symbology spec; the symbology spec confers no meaning on this beyond the positional rule. GS1 GenSpec layers the "element separator" interpretation on top.)
1585
+
The reader applies the inverse transformation per the active compaction mode — e.g. in QR alphanumeric under FNC1-in-first, single `%` decodes to GS while doubled `%%` decodes to literal `%`.
1582
1586
- FNC4 (7-bit symbologies) → next byte lifted to 128-255; FNC4 itself not transmitted.
0 commit comments