bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: localcharset: optimize code for native Windows.


From: Eli Zaretskii
Subject: Re: localcharset: optimize code for native Windows.
Date: Tue, 17 Dec 2019 18:28:55 +0200

> From: Bruno Haible <address@hidden>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]