Codes That Name Their Character Set

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.

What This Example Shows

  • Nine codes, each naming the character set its bytes are in.
  • QR, Data Matrix, Aztec and PDF417 codes on one page.
  • Under each code, the text it spells and the number of its set.

The Source Code, Complete

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

The Document Itself

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

Codes That Name Their Character Set, first page

The Same Document in Other Languages

This document weighs 29.1 kB

Examples Near This One

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.

QR codes

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.

Data Matrix Codes

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.

PDF417 Codes

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.

Aztec Codes

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.

Every example, by subject