On 1 April 2015 at 18:58, Stanislav Malyshev <smalys...@gmail.com> wrote:
> Hi!

Stanislav Malyshev wrote:
> Library should not assume it runs in C locale,

Because it is not thread-safe, it is not safe for libraries to alter the locale.

I can't see any workaround to make this 'just work' - when printf
cannot be relied on to work in a particular way, there is nothing the
library could do to run safely.

The only sensible thing a library could do in a non-C locale is to not
run.....but as setlocale is not thread safe, that is not possible to
detect correctly.

> I don't think we should remove it. I do think we should warn people that
> in this day and age, setlocale() is very bad way of doing
> internationalization except for very specific cases when you know what
> you are doing.

Is there anything we can do that makes people more aware of it's side
effects, other than to make the warning larger on the manual page?

cheers
Dan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to