data.day

Myth: Unicode Problems Are Rare

Think weird characters are a rare edge case? They are the silent killers of your database. Learn to build a Unicode sanitizer.

The Silent Database Killer

You are running the end-of-month revenue reconciliation. You pull the export from the billing platform and match it against the CRM. You have a massive error rate. Fifty accounts are showing up as “Unmatched.” You open the sheet, lean close to your monitor, and compare the two strings.

CRM says: Joe's Garage Billing says: Joe’s Garage

Look closely. The first uses a straight apostrophe. The second uses a curly “smart” apostrophe because a sales rep originally drafted the contract in Microsoft Word and copy-pasted the name. The operational cost of this single, tiny curve of pixels is catastrophic. Your team will spend three hours manually verifying those fifty accounts. We accept this as a rare glitch. It is not. Unicode formatting issues are a daily plague. If you believe this is a rare edge case, you are bleeding time. The structured fix is not a company memo about typing carefully. The fix is a quick sanitizer script that eradicates the weirdness at the door.

The Chaos: The chaos begins the moment human hands touch a keyboard. Modern operating systems are designed to make text look pretty for human eyes. Word processors automatically convert straight quotes to smart quotes. Web browsers insert non-breaking spaces ( ) to keep words together on a line. PDFs are notorious for harboring invisible formatting characters.

When your team copies and pastes from these sources into your CRM, they are dragging a zoo of invisible gremlins into your database. The manual drag of hunting down these characters is an insult to your team’s intelligence. It turns highly paid professionals into data janitors. When a VLOOKUP fails, we assume the data is missing, so we create a duplicate record. The chaos compounds.

The System: We do not rely on humans to “Paste without formatting.” We automate the boring work so we can do the real work. We build a Quick Sanitizer—a digital checkpoint that intercepts incoming text and forcibly converts it into machine-friendly strings.

Here is how you construct the sanitizer using If/Then logic and basic replacement rules.

The Sanitizer Protocol

Whether you build this in Zapier, Power Automate, or directly in Google Sheets, the logic is identical. We run every critical text field through a targeted “Find and Replace” sequence.

  1. The Smart Quote Sweeper:
    • IF the text contains ‘ or ’ (curly single quotes), THEN replace with ' (straight single quote).
    • IF the text contains “ or ” (curly double quotes), THEN replace with " (straight double quote).
  2. The Invisible Space Eliminator:
    • IF the text contains a non-breaking space (often represented in code as \xA0 or CHAR(160)), THEN replace it with a standard space (\x20 or CHAR(32)).
    • Why this matters: A non-breaking space looks exactly like a regular space on your screen, but it will absolutely destroy a formula.
  3. The Dash Normalizer:
    • IF the text contains an en-dash (–) or an em-dash (—), THEN replace it with a standard hyphen (-).

Implementation in the Real World

If you are using Google Sheets as an intake form for client data, you do not let the team work out of the raw input tab.

You create a Clean_Data tab. In the first column, you wrap the raw input in a sequence of substitution formulas:

=SUBSTITUTE(
  SUBSTITUTE(Raw!A2, CHAR(160), " "),
  "’", "'"
)

This short example covers the non-breaking space and right curly apostrophe only. Add the other agreed substitutions separately, preserve the source text, and review matching collisions.

If you are using Power Automate to push data from an email into your database, you insert a “Compose” action. You write an expression using the replace() function to strip the smart quotes before the data is allowed into the SQL table.

Human view versus character view. The apostrophes look similar; the two kinds of space can look identical. Code-point labels make the difference visible without colour.

SOURCE       CHARACTER SEQUENCE
CRM          Joe[U+0027]s[U+0020]Garage
Pasted text  Joe[U+2019]s[U+00A0]Garage

U+0027 = straight apostrophe   U+2019 = curly apostrophe
U+0020 = normal space         U+00A0 = non-breaking space

TARGETED COMPARISON KEY
U+2019 -> U+0027
U+00A0 -> U+0020
Result: Joe's Garage

Keep the original text. Apply only the agreed replacements.
Equal comparison keys identify candidates, not identity.

Clear is kind. Unclear is unkind. Allowing invisible characters to break your business logic is profoundly unkind to your operations team. Process is not bureaucracy. Process is freedom. When you build the sanitizer, the data behaves perfectly. The matches succeed. Stop fighting the symptoms and cure the disease. Let the script do the cleaning.

FAQs

Why doesn't the database just ignore the weird characters?

Because databases are literal. To a computer, a standard straight quote and a slanted 'smart' quote are two entirely different mathematical entities. It cannot guess your intent; it just fails the match.

Can't we just tell the team to use 'Paste as Plain Text'?

No. Telepathy is not a management strategy, and hoping people remember a keyboard shortcut is a guaranteed failure. You must build a system that sanitizes the data regardless of how they paste it.

Will a sanitizer script delete actual important data?

No. A properly built sanitizer uses targeted replacement. It doesn't delete the apostrophe in 'O'Connor'; it merely swaps the curly version for the straight version. The meaning remains perfectly intact.