Code 128 and Retail Barcodes
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
A code carries bytes, not letters. The scanner that reads it has to work out which character set turned the letters into those bytes, and when the code does not say, it falls back on the one it was built with. A plain reference in capitals and figures survives that guess. A Greek greeting, a Polish town or a price with a euro sign comes back right on one scanner and as a row of wrong letters on the next, and nothing on the page shows it until somebody scans it.
Each code on this page is handed bytes already written in a set, and names that set ahead of them, so a scanner that honours the standard reads them in it. A QR code in Latin-1, a Data Matrix in Greek and an Aztec code in Latin-9 stand side by side; under them, PDF417 codes in Latin-2, Cyrillic, Shift JIS, Windows-1252, plain ASCII and raw binary. Under each code stand the text its bytes spell and the number the standard's register gives its set.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.
Read the Rust source Read the Python source
Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.
The code industry marks small parts with: still readable at sizes where a QR code has given up, on a circuit board or a phial in a laboratory tray.
The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.
The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.
Nine barcodes from the workshop, the warehouse, the till, the blood bank and the book trade, each printed above the text a scanner reads back from it.