Names your form should accept

Some real names fail checks that look reasonable. Put them in your test data on purpose, and the manifest says each one should be accepted.

Four kinds of name that get refused

An apostrophe: O'Brien, D'Arcy. A check that allows only letters refuses them. Worse, code that builds an SQL query by pasting the name into its text breaks on the apostrophe, because in SQL an apostrophe ends a quoted text. SQL injection uses the same mistake, and the fix is the same: send the name as a parameter of the query, never as part of its text.

A letter with a mark: José, Łukasz, Wójcik, Dvořák. A pattern such as [A-Za-z]+ refuses them, and even names in English can have such letters. Keep them in a Unicode encoding all the way from the form to the database, as the W3C advises, or the marks can be lost on the way.

Chinese, Japanese or Korean writing: 佐藤, 민준, 李明. The ones in this data are two characters long, so a rule that a name has at least three refuses them, and so does any check limited to the Latin alphabet.

The surname Null. It is a real surname. Code that writes a missing value as the word null, or reads that word back as missing, cannot tell this person from an empty field. In 2016 the BBC reported that airline websites had told Jennifer Null, again and again, that she had left the surname field blank.

Test data with these names

The recipe below makes a hundred sign-ups and puts one of these names in about a fifth of them. Every name comes from a short list of real ones, so the value in your report is a name somebody has, not a misspelt one.

names-your-form-should-accept.yaml
# Sign-ups with a real name careless validation refuses in about a fifth of the
# rows: an apostrophe as in O'Brien, a letter with a mark as in José, a name in
# Chinese, Japanese or Korean writing, or the surname Null.
#
# Each one is a name somebody has, and the manifest says your form should accept
# every one. It also lists the damage this build could not carry out, with the
# reason.
#
#   qadg generate names-your-form-should-accept.yaml
#
# writes signup.csv, expectation-manifest.json and run-note.json. The same seed
# puts in the same names on every machine.
version: "0.1"
seed: "names-your-form-should-accept"
locale: en-US
entities:
  signup:
    count: 100
    fields:
      first_name: { generator: first_name, max_length: 40 }
      last_name:  { generator: last_name, max_length: 40 }
policy:
  layers: [REV]
  rows: 20%
  per_row: exactly_one
output:
  format: csv

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

terminal
$ qadg generate names-your-form-should-accept.yaml
       signup: 100 rows, 2 columns
1 table, 100 rows written
19 defects ordered, 12 applied, manifest in expectation-manifest.json
7 defects could not be applied, and the manifest carries the reason for each one
  7 because this build has no implementation of them yet

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

REV.name.apostropheaccept

signup 3, column last_name

Hayes → D'Angelo

REV.name.cjkaccept

signup 7, column first_name

Mariah → 伟明

REV.name.diacriticsaccept

signup 14, column last_name

Conley → Wójcik

REV.name.null_surnameaccept

signup 17, column last_name

Faulkner → Null

REV.name.apostropheaccept

signup 34, column last_name

Mcclain → D'Arcy

REV.name.cjkaccept

signup 45, column first_name

Gene → 민준

REV.name.diacriticsaccept

signup 58, column last_name

Cortez → Gonçalves

REV.name.null_surnameaccept

signup 62, column last_name

Cantrell → Null

REV.name.apostropheaccept

signup 90, column last_name

Ewing → O'Brien

REV.name.cjkaccept

signup 93, column first_name

Sergio → 민준

REV.name.diacriticsaccept

signup 94, column first_name

Joe → Łukasz

REV.name.null_surnameaccept

signup 95, column last_name

Castillo → Null

Every one is marked accept. A rejection of any of them is a person your application turned away, and qadg verify reports it and ends with exit code 4. A name longer than its column is never put in: the column says what it holds, and your application is right to refuse a name that does not fit.

What your form should do

  • Accept letters of any script, with apostrophes and marks. Check the length, not the alphabet.
  • Do not ask for more than one character. Some people have a name of one letter.
  • Do not require a family name. Many people have a given name only.
  • Keep names in a Unicode encoding from the form to the database.
  • Send names to the database as parameters of the query.
  • Treat the word Null as a name like any other. Only an empty field is a missing one.

Patrick McKenzie lists forty such false assumptions in Falsehoods Programmers Believe About Names, and the W3C article Personal names around the world explains how names differ from one culture to another.

Sources

  • Personal names around the world, W3C Internationalization, read on 16 November 2026.
  • Patrick McKenzie, Falsehoods Programmers Believe About Names, 2010, read on 16 November 2026.
  • Chris Baraniuk, These unlucky people have names that break computers, BBC Future, 25 March 2016, read on 16 November 2026.
  • SQL Injection Prevention Cheat Sheet, OWASP, read on 16 November 2026.