Text / matching failures

Find invisible characters that break product-code matching

A zero-width space or non-breaking space can break equality even when a code looks identical. Record position, kind and original text; do not change an identifier without owner approval.

Separate position and kind

PositionKindVisible sampleDecision
2zero-width spaceAB​CReview
4non-breaking spaceC 123Review
8tab123 XKeep original
noneABC 123 XKeep original

Positions are zero-based examples. Detection does not mean that removal is safe.

Reproduce it with fixtures

Compare mixed-code.txt with clean-code.txt, then match positions, kinds and decisions in expected.csv. Keep the original product code separate from a display-only proposal.

[...text].map((char, index) => ({
  index, codePoint: char.codePointAt(0), char
}));

Review before changing

  1. Keep the original and record position and kind.
  2. Separate an identifier from display-only text.
  3. Confirm that the owner permits removal or replacement.
  4. If the contract is unknown, review it and use the original as the key.

This guide is static browser-local material. Text and input are not sent to an external server.

Do not change identifiers automatically

An invisible character may be invalid, but not every space or control character is disposable. Until the product-code owner approves the repair, hand off the original and the display proposal separately.