> From: Bruno Haible <[email protected]> > Date: Tue, 17 Dec 2019 15:06:50 +0100 > > The localcharset code for native Windows first fetches > setlocale (LC_ALL, NULL), then notices "oh, this is not what we want", > then fetches setlocale (LC_CTYPE, NULL). > > Example: > > LC_CTYPE => "English_United States.1252" > LC_NUMERIC => "French_France.1252" > LC_TIME => "German_Germany.1252" > LC_ALL => "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United > States.1252;LC_MONETARY=English_United > States.1252;LC_NUMERIC=French_France.1252;LC_TIME=German_Germany.1252" > > This can be optimized.
But your optimization drops LC_ALL entirely, which may not be a good idea, because LC_CTYPE might not be set. And what is the rationale for trying to optimize this? Are these functions supposed to be used in tight time-critical loops or something? The original code has a main success scenario that should work in 99.99% of use cases, so I'm not sure I see the optimization here, even if we need it.
