3 ms·
Speaking as someone who wrote a Standard C library like this many years ago, I can confirm. All of the work is done inside setlocale(), switching (or construct
by JdeBP 6y ago
Speaking as someone who wrote a Standard C library like this many years ago, I can confirm. All of the work is done inside setlocale(), switching (or constructing) tables. The character type functions devolve to a single table lookup.
For those interested: The technique is used in P. J. Plauger's 1992 The Standard C Library and has been around a long time.