-
Notifications
You must be signed in to change notification settings - Fork 10
Description
It looks for me that current locale tries to be the GCD for all supported platforms, so it behaves like the simplest platform (CGI) behaves. But other platforms may have richer API, i.e. in case of CGI we have only one value for all locale categories, but in POSIX world we may have different values for different categories like LC_MESSAGES, LC_CTYPE, etc.
I didn't think of this when I proposed you this pull request (mutoh#5), especially commit mutoh@0ef254f, which fixes issues with encoding handling (LC_CTYPE), but breaks handling of LC_MESSAGES (for example, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690572).
So currently I see three possibilities:
- revert commits with LC_CTYPE and break charset handling again (simple but bad)
- like 1, but change Locale::Driver::Env.charset to check environmental variables LC_ALL and LC_CTYPE (a bit harder and a bit better);
- extend API to better reflect POSIX (the hardest but the best, may change API in incompatible way)
The case 2 may be enough for the short term perspective but for long term case 3 looks better but it may require to refactor/rearchitect the whole gem.