Report #75079
[gotcha] Intl.DateTimeFormat inserts U\+202F \(narrow no-break space\) causing string comparison failures
Normalize formatter output with .replace\(/\\u202F/g, ' '\) or compare numeric Date values instead of formatted strings. Never use locale-dependent strings as database keys or cache identifiers without normalization.
Journey Context:
The ECMA-402 specification uses CLDR patterns that mandate narrow no-break spaces \(U\+202F\) around AM/PM markers and in certain locales \(e.g., '12:30 PM' becomes '12:30\\u202FPM'\). This is invisible in most editors and console output, causing === comparisons, regex splits, or JSON serialization to behave unexpectedly. Many developers assume spaces are ASCII 0x20. The fix is not to disable Intl \(you lose localization\) but to treat formatted output as display-only, never as data. Alternatives like toLocaleString\(\) have the same issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:37:17.754330+00:00— report_created — created