justusjonas74 / uic-918-3

Package for decoding and parsing barcodes according to UIC-918.3 specification, which are used commonly on public transport online tickets.
MIT License
39 stars 4 forks source link

Missing UIC 918-9 compatibility #16

Open arnebr opened 9 months ago

arnebr commented 9 months ago

The UIC barcode standard was adopted in 2006 as version UIC 918-3. The implementation at that time was based on a tabular recording of relevant ticket data in the barcode, which is displayed in this format on the control device during inspection. The layout-based procedure (TLB), which consists of at least the segments U_HEAD and U_TLAY, does not provide for automated evaluation of barcode contents and is considered outdated by today's standards. Therefore, further formats have been developed for optimized display on control devices (for example, the left-aligned (PLAIN) layout of the TLB, as well as manufacturer-specific layouts), all of which are widely known in the market under the designation UIC 918-3. Additionally, the functionality can vary depending on the interpretation of the TLB by different providers of control devices and software.

Therefore, an update of the UIC standard was carried out in 2018: Version 918-9. The new barcode standard includes, in addition to the contents already described in UIC 918-3, the definition of a structured component: Flexible Content Barcode (FCB). In the FCB component, data are encoded in a structured form so that the contained data can be specifically used for automated evaluation. The central barcode segment of the FCB is designated as U_FLEX. With version 0.5.0 we are able to decode the message but not interpret the U_FLEX.

The UIC 918-9 standard is an extension of UIC 918-3 and accordingly contains, among other things, the specification of both the FCB and the TLB. The Germany ticket (Deutschlandticket) is expected to make use of the backward compatibility of the standard during a transition period and use the necessary segments for both TLB and FCB. The TLB can be output either in the left-aligned PLAI layout or in the RCT2 format. The document outlining this

A corresponding java library is available here: https://github.com/UnionInternationalCheminsdeFer/UIC-barcode A library in C++ with create links to specs is here: https://github.com/karlheinzkurt/ticket-decoder