Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As long as the library supports decoding of the FNC1 special character, it can be used to read GS1 codes. The FNC1 character is not a byte in the data-stream, but more of a formatting symbol.</p> <p>The specification says that a leading FNC1-character is used to identify GS1 barcodes, and should be decoded as <code>"]d2"</code> (GS1 DataMatrix), <code>"]C1"</code> (GS1-128), <code>"]e0"</code> (GS1 DataBar Omnidirectional) or <code>"]Q3"</code> (GS1 QR Code). Any other FNC1-characters should be decoded as ASCII GS-characters (byte value 29).</p> <p>Depending on the library, the leading FNC1 might be missing, or decoded as <code>GS</code> (not critical), or the embedded FNC1-characters might be missing (critical). The embedded FNC1-characters are used to delimit variable-length fields.</p> <p>You can read the full specification <a href="http://www.gs1.se/Global/Om-GS1-Systemet/GS1-General-Specifications.pdf" rel="nofollow">here</a> (pdf). The algorithm for decoding the data can be found under heading <strong>7.9 Processing of Data from a GS1 Symbology using GS1 Application Identifiers</strong> (page 426).</p> <p>The algorithm goes something like this:</p> <pre><code>Peek at the first character. If it is ']', If string does not start with ']C1' or ']e0' or ']d2' or ']Q3', Not a GS1 barcode. Stop. Consume the caracters. Else if it is &lt;GS&gt;, Consume character. Else, No symbology identifier, assume GS1. While not end of input, Read the first two digits. If they are in the table of valid codes, Look up the length of the AI-code. Read the rest of the code. Look up the length of the field. If it is variable-length, Read until the next &lt;FNC1&gt; or &lt;GS&gt;. Else, Read the rest if the field. Peek at the next character. If it is &lt;FNC1&gt; or &lt;GS&gt;, consume it. Save the read field. Else, Error: Invalid AI </code></pre> <hr> <p>The binary data in the QR Code is encoded as 4-bit tokens, with embedded data.</p> <pre><code>0111 -&gt; Start Extended Channel Interpretation (ECI) Mode (special encodings). 0001, 0010, 0100, 1000 -&gt; start numeric, alphanumeric, raw 8-bit, kanji encoded data. 0011 -&gt; structured append (combine two or more QR Codes to one data-stream). 0101 -&gt; FNC1 initial position. 1001 -&gt; FNC1 other positions. 0000 -&gt; End of stream (can be omitted if not enough space). </code></pre> <p>After an encoding specification comes the data-length, followed by the actual data. The meanings of the data bits depends on the encoding used. In between the data-blocks, you can squeeze FNC1 characters.</p> <p>The QR Code specification (<a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43655" rel="nofollow">ISO/IEC 18004</a>) unfortunately costs money (210 Franc). You might find some pirate version online though.</p> <p>To create GS1 QR Codes, you need to be able to specify the FNC1-characters in the data. The library should either recognize the "]Q3" prefix and GS-characters, or allow you to write FNC1 tokens via some other method.</p> <p>If you have some way to write the FNC1-characters, you can encode GS1 data as follows:</p> <pre><code>Write initial FNC1. For each field, Write the AI-code as decimal digits. Write field data. If the code is a variable-length field, If not the last field, Write FNC1 to terminate the field. </code></pre> <p>If possible, you should order the fields such that a variable-length field comes last.</p> <hr> <p>As noted by Terry Burton in the comments; The FNC1 symbol in a GS1 QR Code can be encoded as <code>%</code> in alphanumeric data, and as GS in byte mode. To encode an actual percent symbol, you write it as <code>%%</code>.</p> <p>To encode <code>(01) 04912345123459 (15) 970331 (30) 128 (10) ABC123</code>, you first combine it into the data string <code>01049123451234591597033130128%10ABC123</code> (<code>%</code> indicator is the encoded FNC1 symbol). This string is then written as</p> <pre><code>0101 - Initial FNC1, GS1 mode indicator 0001 - QR numeric mode 0000011101 - Data length (29) &lt;data bits for "01049123451234591597033130128"&gt; 0010 - QR alphanumeric mode 000001001 - Data length (9) &lt;data bits for "%10ABC123"&gt; </code></pre> <p>(Example from the ISO 18004:2006 specification)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload