Names and Unicode

Real names a strict check refuses, and Unicode that careless code mangles, in about a fifth of the rows, each with what your application should do.

en-US 1 table 100 rows CSV damage UNI, REV

The values marked accept are names real people have: O’Brien, Łukasz, a name in Chinese characters, even the surname Null. An application that refuses them turns people away. The Unicode marked with ~ depends on your own rules: an emoji in a city name may be fine in one system and a fault in another, and a zero-width space is invisible on the screen and still makes two values differ. The manifest says which is which, and you decide the ones marked ~.

Run it again with another seed for other names and other damage.

The recipe

names-and-unicode.yaml
# Names and cities that careless code mishandles, asked for in about a fifth of
# the rows.
#
# Real names a strict check refuses, such as Null, Łukasz or a name in Chinese,
# Japanese or Korean characters, which your application should accept. Emoji,
# an invisible zero-width space, a Turkish dotless i or another Unicode form of
# the same text, where the right answer depends on your own rules. The manifest
# says which is which for every value it changed, and lists the damage this
# build could not carry out, with the reason.
#
#   qadg generate names-and-unicode.yaml
#
# writes person.csv, expectation-manifest.json and run-note.json. The same seed
# changes the same values on every machine.
version: "0.1"
seed: "names-and-unicode"
locale: en-US
entities:
  person:
    count: 100
    fields:
      first_name: { generator: first_name, max_length: 40 }
      last_name:  { generator: last_name, max_length: 40 }
      city:       { generator: city }
policy:
  layers: [UNI, REV]
  rows: 20%
  per_row: exactly_one
output:
  format: csv

Run it

Save the recipe, then run this in the same folder. This is what the program printed for it.

terminal
$ qadg generate names-and-unicode.yaml
       person: 100 rows, 3 columns
1 table, 100 rows written
26 defects ordered, 17 applied, manifest in expectation-manifest.json
9 defects could not be applied, and the manifest carries the reason for each one
  3 because the values in those rows did not suit them
  6 because this build has no implementation of them yet

What it writes

person.csv

The first 5 of its 100 rows.

first_namelast_namecity
BrentAveryAtlasburg
KaraNobleShartlesville
TroyOchoaCincinnati
KarenBurchGlenwood
MarisaHaleyAbilene

expectation-manifest.json

Every defect the recipe ordered: where it is, the value before and after, and what your application should do with it. A defect this build could not apply is there too, with the reason.

run-note.json

The seed, the locale and the versions behind the run, and every table it wrote with its rows and columns.

What it damaged

The recipe ordered 26 defects, and this build applied the 17 below. The other 9 are in the manifest as not applied, each with its reason, and the run above counts them by reason.

REV.name.cjkaccept

person 7, column last_name

Dickerson → 佐藤

UNI.normalization.non_idempotent~ reject

person 10, column last_name

Jackson → ᴶᴬꟲᴷsᴼᴺ

REV.name.diacriticsaccept

person 13, column first_name

Bryan → Małgorzata

UNI.zero_width.space~ reject

person 15, column last_name

Avila → Av\u200bila

REV.name.null_surnameaccept

person 16, column last_name

Houston → Null

UNI.case.turkish_dotless_i~ accept

person 19, column first_name

Christopher → Chrıstopher

UNI.emoji.basic~ accept

person 28, column first_name

Edwin → Edwin 🙂

UNI.emoji.zwj_sequence~ accept

person 36, column first_name

Cesar → Cesar 👩‍👩‍👧‍👦

REV.name.apostropheaccept

person 38, column last_name

Mccullough → D'Angelo

REV.name.cjkaccept

person 43, column first_name

Jacob → 伟明

UNI.normalization.non_idempotent~ reject

person 46, column city

Allenwood → ᴬᴸᴸᴱᴺᵂᴼᴼᴰ

REV.name.diacriticsaccept

person 50, column first_name

Terri → Łukasz

UNI.zero_width.space~ reject

person 52, column first_name

Pam → P\u200bam

REV.name.null_surnameaccept

person 60, column last_name

Nichols → Null

UNI.emoji.basic~ accept

person 73, column first_name

Tara → Tara 🙂

UNI.emoji.zwj_sequence~ accept

person 79, column city

Monroeville → Monroeville 👩‍👩‍👧‍👦

REV.name.apostropheaccept

person 82, column last_name

Mcneil → O'Brien