Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The concept of a process-wide locale was a mistake. All locale-dependent functons should be explicit. Yes that means some programs won't respect your locale because the author didn't care to add support but at least they won't break in unexpected ways because some functions magically work differently between the user's and developers system.


Totally agree. Python's gettext() API feels so ancient because it can only cope with one locale at a time, and it would love to get that locale from an environment variable. Not ideal for writing an HTTP service that sends text based on the Accept-Language header.


It was a very reasonable design when most programs were local-only.


It really wasn't. Even local-only programs need to process data that isn't formatted in the user's locale.


thread-local locale you can easily save and restore would work. In other words, dynamically scoped.

But you don't want to be processing data in locale dependent-ways using the crap available in ISO C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: