mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
scr_intl.c is the ICU-backed unit: Intl.Segmenter word granularity over ICU's UAX #29 iterator, and Number/Date toLocaleString and toLocaleTimeString at the DEFAULT locale (uloc_getDefault, the same answer V8 gets). The engine-free fast paths keep their own units: the table-driven grapheme segmenter in scr_grapheme.c and the embedded en-US number format in scr_lib.c. ICU's data file is looked up beside the executable first ($ORIGIN-style, via /proc/self/exe and its peers) and left to ICU's own search after that (ICU_DATA). A program that uses Intl without the file throws a named Error instead of formatting from nothing. process.config.variables.v8_enable_i18n_support answers 1, as Node does: the read lowers to this unit, so the flag is true of the binary that reports it and no binary that reports it can lack ICU. Two dynamic-tier tags (SEGMENTER_WORD, SEGMENTS_WORD) carry the handle kinds, appended at the end of the list so pinned numbers do not move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>