Unicode, Diacritics & CJK Address Normalization in Production Systems
Why String.prototype.normalize("NFKC") rescues Japanese mobile shoppers and how byte-length limits truncate UTF-8 street lines.
Full-Width Digits & Japanese Postal Symbols (〒150-0001)
Japanese IME users frequently enter full-width digits and prolonged sound marks (〒150-0001 or 150ー0001). A strict ASCII regex /^\d{3}-\d{4}$/ rejects valid customers unless you apply NFKC normalization, strip the leading 〒 marker, and fold Unicode dash variants to ASCII hyphen-minus before matching.
function normalizeJapanesePostal(raw) {
const nfkc = String(raw).normalize('NFKC').trim();
const clean = nfkc.replace(/^〒\s*/, '').replace(/[‐‑‒–—―\u30FC]/g, '-').replace(/\s+/g, '');
return /^\d{7}$/.test(clean) ? `${clean.slice(0, 3)}-${clean.slice(3)}` : clean;
}
// normalizeJapanesePostal('〒150-0001') === '150-0001' European Diacritics, ß Ligatures & Byte-vs-Char Limits
German Friedrichstraße, French Rue de l'École, and Turkish Çankaya require multi-byte UTF-8 encoding. Legacy ERP tables defined as VARCHAR(35 BYTE) or Latin-1 carrier APIs (UPS/FedEx/DHL) often slice mid-character or mangle ß and ü. Use AddressQA’s Unicode Diacritics and 120-Char Long Street torture presets to test both UTF-8 persistence and graceful ASCII transliteration.
Apostrophes & Hyphens in Recipient Names
Names like Claire O'Connor-Mercer break unparameterized SQL logs, XML SOAP carrier payloads, and overly strict /^[a-zA-Z ]+$/ frontend patterns. Toggle the Hyphen/Apostrophe Name preset in AddressQA to validate every checkout touchpoint.