1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-05-07 22:53:47 +00:00

AZTEC: add manual FNC1 support:

improve P/S vs P/L choice when have ECI;
  add ZINT_DEBUG_TEST dump
AUSPOST: allow variable length data input
DATAMATRIX: do `EXTRA_ESCAPE_MODE` processing up front & check have
  non-zero length afterwards;
  disallow `READER_INIT` and `EXTRA_ESCAPE_MODE`;
general: add new `z_zero_fill()` func & use;
  add new `z_extra_escape_position_fnc1()` helper;
  in `z_ct_set_seg_extra_escapes_eci` check position FNC1 whether
  or not have ECI
library: escape_char_process: note escaped backslash followed by
  caret by passes `EXTRA_ESCAPE_MODE` check
test suite: BWIPP: update to latest; support AUSPOST variants;
  process `EXTRA_ESCAPE_MODE` escaping up front
This commit is contained in:
gitlost
2026-04-27 01:02:25 +01:00
parent b40393723f
commit 0a3ffc1dc2
31 changed files with 1968 additions and 905 deletions

View File

@@ -1515,25 +1515,25 @@ Sequences</caption>
<tr>
<td style="text-align: left;"><code>\^1</code></td>
<td style="text-align: left;">Insert <code>FNC1</code> character</td>
<td>Code128, Data Matrix</td>
<td>Aztec Code, Code 128, Data Matrix</td>
</tr>
<tr>
<td style="text-align: left;"><code>\^^</code></td>
<td style="text-align: left;">Literal <code>\^</code></td>
<td>Code128, Data Matrix</td>
<td>Aztec Code, Code 128, Data Matrix</td>
</tr>
<tr>
<td style="text-align: left;"><code>\^A</code>, <code>\^B</code>,
<code>\^C</code></td>
<td style="text-align: left;">Select Code Set A, B or C
respectively</td>
<td>Code128 only</td>
<td>Code 128 only</td>
</tr>
<tr>
<td style="text-align: left;"><code>\^@</code></td>
<td style="text-align: left;">Exit manual Code Set selection and resume
automatic Code Set selection</td>
<td>Code128 only</td>
<td>Code 128 only</td>
</tr>
</tbody>
</table>
@@ -4297,7 +4297,8 @@ other shortcuts if available (affects <code>AZTEC</code>,
<tr>
<td style="text-align: left;"><code>EXTRA_ESCAPE_MODE</code></td>
<td style="text-align: left;">Process special symbology-specific escape
sequences (<code>CODE128</code> and <code>DATAMATRIX</code> only).</td>
sequences (<code>AZTEC</code>, <code>CODE128</code> and
<code>DATAMATRIX</code> only).</td>
</tr>
<tr>
<td style="text-align: left;"><code>GS1SYNTAXENGINE_MODE</code></td>
@@ -4740,8 +4741,8 @@ alt="zint -b C25INTER --compliantheight -d &quot;9212320967&quot;" />
<p>No check digit is added by default, but can be set the same as for <a
href="#standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a>.</p>
<h4 id="code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</h4>
<p>Data Logic can encode numeric input (digits 0-9) up to a maximum of
113 digits.</p>
<p>Data Logic, also known as China Post or Hong Kong 2 of 5, can encode
numeric input (digits 0-9) up to a maximum of 113 digits.</p>
<figure>
<img src="images/c25logic.svg" class="lin"
alt="zint -b C25LOGIC -d &quot;9212320967&quot;" />
@@ -5998,7 +5999,7 @@ alt="zint -b PHARMA_TWO --compliantheight -d &quot;29876543&quot;" />
</figure>
<h3 id="postnet">6.4.2 POSTNET</h3>
<p>Used by the United States Postal Service until 2009, the POSTNET
barcode was used for encoding zip-codes on mail items. POSTNET uses
barcode was used for encoding ZIP codes on mail items. POSTNET uses
numerical input data and includes a modulo-10 check digit. While Zint
will encode POSTNET symbols of up to 38 digits in length, standard
lengths as used by USPS were <code>PostNet6</code> (5-digit ZIP input),
@@ -6085,69 +6086,75 @@ alt="zint -b AUSPOST --compliantheight -d &quot;96184209&quot;" />
<p>Valid data characters are 0-9, A-Z, a-z, space and hash (#). A Format
Control Code (FCC) is added by Zint and should not be included in the
input data. Reed-Solomon error correction data is generated by Zint.
Encoding behaviour is determined by the length of the input data
according to the formula shown in the following table. The first 8
digits is the DPID.</p>
Encoding behaviour is determined by the length and type of the input
data as shown in the following table, where <code>C</code> means any
valid character.</p>
<table id="tbl:auspost_input_formats" style="width:86%;">
<caption><span class="table-label">Table 23:</span> Australia Post Input
Formats</caption>
<colgroup>
<col style="width: 13%" />
<col style="width: 38%" />
<col style="width: 11%" />
<col style="width: 20%" />
<col style="width: 22%" />
<col style="width: 12%" />
<col style="width: 8%" />
<col style="width: 6%" />
<col style="width: 12%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Input Length</th>
<th style="text-align: left;">Required Input Format</th>
<th>Symbol Length</th>
<th style="text-align: left;">DPID (required)</th>
<th style="text-align: left;">Customer Data (optional)</th>
<th style="text-align: left;">Symbol Length</th>
<th>FCC</th>
<th>Encoding Table(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">8</td>
<td style="text-align: left;"><code>99999999</code></td>
<td>37-bar</td>
<td style="text-align: left;">1-8</td>
<td style="text-align: left;">1 to 8 digits</td>
<td style="text-align: left;">None</td>
<td style="text-align: left;">37 bars</td>
<td>11</td>
<td>N</td>
</tr>
<tr>
<td style="text-align: left;">13</td>
<td style="text-align: left;"><code>99999999AAAAA</code></td>
<td>52-bar</td>
<td style="text-align: left;">9-13</td>
<td style="text-align: left;">8 digits</td>
<td style="text-align: left;">1 to 5 <code>C</code></td>
<td style="text-align: left;">52 bars</td>
<td>59</td>
<td>N and C</td>
</tr>
<tr>
<td style="text-align: left;">16</td>
<td style="text-align: left;"><code>9999999999999999</code></td>
<td>52-bar</td>
<td style="text-align: left;">9-16</td>
<td style="text-align: left;">8 digits</td>
<td style="text-align: left;">1 to 8 digits</td>
<td style="text-align: left;">52 bars</td>
<td>59</td>
<td>N</td>
</tr>
<tr>
<td style="text-align: left;">18</td>
<td style="text-align: left;"><code>99999999AAAAAAAAAA</code></td>
<td>67-bar</td>
<td style="text-align: left;">9-18</td>
<td style="text-align: left;">8 digits</td>
<td style="text-align: left;">1 to 10 <code>C</code></td>
<td style="text-align: left;">67 bars</td>
<td>62</td>
<td>N and C</td>
</tr>
<tr>
<td style="text-align: left;">23</td>
<td style="text-align: left;"><code>99999999999999999999999</code></td>
<td>67-bar</td>
<td style="text-align: left;">9-23</td>
<td style="text-align: left;">8 digits</td>
<td style="text-align: left;">1 to 15 digits</td>
<td style="text-align: left;">67 bars</td>
<td>62</td>
<td>N</td>
</tr>
</tbody>
</table>
<p>The special Null FCC 00, non-machine readable and intended for
customer use only, is used (all input lengths) if the DPID is all
zeroes.</p>
<p>The special Null FCC 00, intended for customer use only, is used (all
input lengths) if the DPID is all zeroes.</p>
<h4 id="reply-paid-barcode">6.5.1.2 Reply Paid Barcode</h4>
<p>A Reply Paid version of the Australia Post 4-State Barcode (FCC 45)
which requires an 8-digit DPID input.</p>
@@ -6282,10 +6289,10 @@ alt="zint -b USPS_IMAIL --compliantheight -d &quot;01234567094987654321-01234&qu
<figcaption><span class="figure-label">Figure 108:</span>
<code>zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"</code></figcaption>
</figure>
<p>Intelligent Mail is a fixed length (65-bar) symbol which combines
<p>Intelligent Mail is a fixed length 65-bar symbol which combines
routing and customer information in a single symbol. Input data consists
of a 20-digit tracking code, followed by a dash (<code>-</code>),
followed by a delivery point zip-code which can be 0, 5, 9 or 11 digits
followed by a delivery point ZIP code which can be 0, 5, 9 or 11 digits
in length. For example all of the following inputs are valid data
entries:</p>
<ul>
@@ -7764,6 +7771,14 @@ length of approximately 3823 numeric or 3067 alphabetic characters or
1914 bytes of data. A separate symbology ID
(<code>BARCODE_HIBC_AZTEC</code>) can be used to encode Health Industry
Barcode (HIBC) data.</p>
<p>Manual insertion of <code>FNC1</code> is possible using the
<code>--extraesc</code> option (API
<code>input_mode |= EXTRA_ESCAPE_MODE</code>), which apart from
processing normal escape sequences also processes the extra escape
sequences given in <span class="cross-ref-group"><a
href="#tbl:extra_escapes" class="cross-ref">Table 3: Extra Escape
Sequences</a></span> - see <a href="#data-matrix-iso-16022">6.6.1 Data
Matrix (ISO 16022)</a> for details.</p>
<p>For a faster but less optimal encodation, the <code>--fast</code>
option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
<p>Aztec Code supports Structured Append of up to 26 symbols and an
@@ -8520,12 +8535,12 @@ reply mail with a</td>
<tr>
<td>B</td>
<td style="text-align: left;">Used for business reply mail without a
pre-printed zip code.</td>
pre-printed ZIP code.</td>
</tr>
<tr>
<td>C</td>
<td style="text-align: left;">Used for business reply mail with a
pre-printed zip code.</td>
pre-printed ZIP code.</td>
</tr>
<tr>
<td>D</td>
@@ -9421,9 +9436,9 @@ are:</p>
<dt><code>--extraesc</code></dt>
<dd>
<p>As well as processing the normal escape sequences above, process the
special escape sequences beginning with <code>\^</code>. For Code 128
and Data Matrix, process the escape sequence <code>\^1</code> that
inserts an <code>FNC1</code> character, and the escaping sequence
special escape sequences beginning with <code>\^</code>. For Aztec Code,
Code 128 and Data Matrix, process the escape sequence <code>\^1</code>
that inserts an <code>FNC1</code> character, and the escaping sequence
<code>\^^</code> that encodes a literal <code>\^</code>. For Code 128
only, process the escape sequences <code>\^A</code>, <code>\^B</code>,
<code>\^C</code> and <code>\^@</code> that allow manual switching of