1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-25 04:45:58 +00:00

MAILMARK_2D: fix postcode validation: no limited alphanumerics,

spaced-out DPS "outward"-only allowed, all-blank DPS allowed
  (ticket #334, props Milton Neal)
This commit is contained in:
gitlost
2025-04-09 00:10:51 +01:00
parent 86363ff0f7
commit 182c84fa4d
6 changed files with 263 additions and 158 deletions

View File

@@ -3792,15 +3792,14 @@ the following table.
The 6 Destination+DPS (Destination Post Code plus Delivery Point Suffix)
patterns are:
----------- ----------- -----------
FNFNLLNLS FFNNLLNLS FFNNNLLNL
FFNFNLLNL FNNLLNLSS FNNNLLNLS
----------- ----------- -----------
----------- ----------- ----------- ----------- ----------- -----------
ANNLLNLSS AANNLLNLS ANNNLLNLS AANNNLLNL ANANLLNLS AANANLLNL
----------- ----------- ----------- ----------- ----------- -----------
Table : Royal Mail Mailmark Destination+DPS Patterns
Table : Royal Mail 4-State Mailmark Destination+DPS Patterns
where 'F' stands for full alphabetic (A-Z), 'L' for limited alphabetic (A-Z less
where 'A' stands for full alphabetic (A-Z), 'L' for limited alphabetic (A-Z less
'CIKMOV'), 'N' for numeric (0-9), and 'S' for space.
Four of the permitted patterns include a number of trailing space characters -
@@ -3943,37 +3942,49 @@ offers space for customer data following an initial pre-formatted 45 character
section, as summarized below.
Field Name Length Values
------------------ ------------- --------------------------------
------------------ ------------- ---------------------------------
UPU Country ID 4 "JGB "
Information Type 1 Alphanumeric
Version ID 1 "1"
Class 1 Alphanumeric
Supply Chain ID 7 Numeric
Item ID 8 Numeric
Destination+DPS 9 Alphanumeric (1 of 6 patterns)
Destination+DPS 9 Alphanumeric (1 of 13 patterns)
Service Type 1 Numeric
RTS Post Code 7 Alphanumeric (1 of 6 patterns)
RTS Post Code 7 Alphanumeric (1 of 7 patterns)
Reserved 6 Spaces
Customer Data 6, 45 or 29 Anything (Latin-1)
Table : Royal Mail 2D Mailmark Input Fields
The 6 Destination+DPS (Destination Post Code plus Delivery Point Suffix)
patterns are the same as for the 4-state - see Table
: Royal Mail Mailmark Destination+DPS Patterns. The 6 RTS (Return to Sender)
Post Code patterns are the same also except without the additional DPS 'NL',
i.e.
The 13 Destination+DPS (Destination Post Code plus Delivery Point Suffix)
patterns are similar to those for the 4-state except that the alphabetic
limitation ('L' versus 'A') does not apply, only the initial “outward” part is
required (the rest can be blank), and the whole field can be blank:
--------- --------- ---------
FNFNLLS FFNNLLS FFNNNLL
FFNFNLL FNNLLSS FNNNLLS
--------- --------- ---------
----------- ----------- ----------- ----------- ----------- ----------- ------
-----
ANNAANASS AANNAANAS ANNNAANAS AANNNAANA ANANAANAS AANANAANA SSSSSS
SSS
ANSSSSSSS AANSSSSSS ANNSSSSSS AANNSSSSS ANASSSSSS AANASSSSS
----------- ----------- ----------- ----------- ----------- ----------- ------
-----
Table : Royal Mail 2D Mailmark Destination+DPS Patterns
where 'A' is alphabetic (A-Z), 'N' numeric (0-9), and 'S' space.
The 7 RTS (Return to Sender) Post Code patterns are similar to above except
without the DPS ('NA'), and the trailing “inward” part cannot be blank (although
the whole field can be):
--------- --------- --------- --------- --------- --------- ---------
ANNAASS AANNAAS ANNNAAS AANNNAA ANANAAS AANANAA SSSSSSS
--------- --------- --------- --------- --------- --------- ---------
Table : Royal Mail 2D Mailmark RTS Patterns
where 'F' is full alphabetic (A-Z), 'L' limited alphabetic (A-Z less 'CIKMOV'),
'N' numeric (0-9), and 'S' space.
Three sizes are defined, one rectangular, with varying maximum amounts of
optional customer data: