Repository navigation
Input Processing
The data field gives the message that the symbol carries: data characters, which are byte values, and any non-data characters, such as function characters, macros and Extended Channel Interpretations (ECIs), which are given with the parsefnc option.
A reader decodes the symbol and transmits the message to the host according to the transfer protocol of the symbology's specification. Non-data characters have no byte values and are never transmitted directly. Instead they act on the transmitted message:
- Flag characters are signalled by the symbology identifier, a prefix such as
]C1that the reader transmits before the data. For example, FNC1 in first position indicates GS1 data and FNC1 in second position indicates data in a format identified by an AIM application indicator. A symbol containing FNC3 programs the reader, which transmits nothing. - Formatting characters change the transmitted data. For example, FNC1 as a field separator is transmitted as GS (ASCII 29), FNC4 in Code 128 raises the value of the next data character by 128, and a macro character in Data Matrix wraps the message in a header and trailer.
Without ECIs, the reader transmits in the Basic Channel: the data characters as bytes, which the receiving application interprets according to the default interpretation of the symbology, usually ISO/IEC 8859-1, which each symbology page states.
An ECI changes the interpretation of the data characters that follow it. A reader transmits a symbol containing an ECI in the Extended Channel: the symbology identifier signals its use, each ECI is transmitted as a backslash followed by its six-digit number, e.g. \000026, and each backslash among the data characters is transmitted doubled. The receiving application must reverse this escaping to recover the data and the interpretation of each part of it. Readers that are not enabled to transmit symbology identifiers do not transmit such symbols.
The encoder does not convert between character encodings. The data characters must be the bytes of the message in the encoding of its interpretation: the default interpretation, the interpretation of an ECI, such as UTF-8 for ^ECI000026, or one that an application standard requires.
In supporting barcode symbologies, when the parse option is specified, any instances of ^NNN in the data field are replaced with their equivalent byte value, useful for specifying unprintable characters.
Additionally, control character names can be used to specify equivalent ASCII values, as follows:
| Sequence | ASCII value |
|---|---|
^NUL |
0 |
^SOH |
1 |
^STX |
2 |
^ETX |
3 |
^EOT |
4 |
^ENQ |
5 |
^ACK |
6 |
^BEL |
7 |
^BS |
8 |
^TAB |
9 |
^LF |
10 |
^VT |
11 |
^FF |
12 |
^CR |
13 |
^DLE |
16 |
^DC1 |
17 |
^DC2 |
18 |
^DC3 |
19 |
^DC4 |
20 |
^NAK |
21 |
^SYN |
22 |
^ETB |
23 |
^CAN |
24 |
^EM |
25 |
^SUB |
26 |
^ESC |
27 |
^FS |
28 |
^GS |
29 |
^RS |
30 |
^US |
31 |
ASCII control characters SO and SI cannot be encoded by name (since SO would prefix clash with SOH).
Note: When this option is enabled, literal instances of "^" in the data should be escaped as ^094 to avoid replacement if the subsequent data characters represent a valid substitution. For example, literal "^123" in the input data can be escaped as ^094123, literal "^RS" in the data can be escaped as ^094RS, and literal "^ABC" in the data can be escaped as ^094ABC (in case ^ABC becomes a valid substitution in the future).
Equivalent symbols:
Data: This is Data Matrix
Options:
Encoder: datamatrix
Data: This is ^068ata Matrix
Options: parse
Encoder: datamatrix
In supporting barcode symbologies, when the parsefnc option is specified, non-data function characters can be specified by escaped combinations such as ^FNC1, ^FNC@ (FNC1 in second position, see below), ^FNC4, ^SFT/ and ^ECI000003.
Note: When this option is enabled, literal instances of ^ in the input data can be escaped as ^^.
Manually-composed Code 93 Extended demonstrating use of the special shift combination (/)A to represent !:
Data: TERRY^SFT/A
Options: parsefnc includecheck
Encoder: code93
FNC1 in first position, written ^FNC1 at the start of the data, denotes data in GS1 Application Identifier standard format. Elsewhere in the data ^FNC1 is a field separator.
The names first and second position come from Code 128, where FNC1 directly follows the Start character for GS1 data, or follows an AIM application indicator in a single symbol character for AIM data. Other symbologies use the names for these two declarations rather than for literal positions.
- Recommendation: Consider the GS1 encoders, such as GS1-128, GS1 DataMatrix and GS1 QR Code, which take data in GS1 Application Identifier standard format and place every FNC1 automatically.
- A further
^FNC1in the data is a field separator. - ECIs are not available with FNC1 in first position.
Code 128 with FNC1 in first position, and a further FNC1 separating a variable-length field:
Data: ^FNC1010952123454321310ABC123^FNC121XYZ
Options: parsefnc includetext
Encoder: code128
FNC1 in second position marks data that conforms to an industry format identified by an AIM application indicator: one letter or two digits at the start of the data. With the parsefnc option, write ^FNC@ at the start of the data followed by the AIM application indicator, e.g. ^FNC@T... or ^FNC@99..., and the encoder places the FNC1 where the symbology requires it. A reader transmits the AIM application indicator followed by the data, and reports FNC1 in second position in the symbology identifier, e.g. ]C2T... for Code 128.
-
^FNC@is available for Code 128, Code 16K, Code 49, Code 93i, PosiCode, Data Matrix, Data Matrix Rectangular, Data Matrix Rectangular Extension, Aztec Code, Compact Aztec Code, Aztec Mesas, Code One, DotCode, QR Code, Rectangular Micro QR Code, MicroPDF417 and Grid Matrix. The symbology pages give any limits. - The AIM application indicator must be one letter
AtoZoratoz, or two digits. With a digit it is always two characters, so^FNC@123is the AIM application indicator12followed by data3. - A further
^FNC1in the data is a field separator. - ECIs are not available with FNC1 in second position.
Code 128 with AIM application indicator T:
Data: ^FNC@T12345^FNC1ABC
Options: parsefnc includetext
Encoder: code128
Home | Download | Documentation (PDF) | Source | Support | Issues | Online Barcode Generator