Skip to content

Proposal: extend locale api to better reflect posix #2

@375gnu

Description

@375gnu

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:

  1. revert commits with LC_CTYPE and break charset handling again (simple but bad)
  2. like 1, but change Locale::Driver::Env.charset to check environmental variables LC_ALL and LC_CTYPE (a bit harder and a bit better);
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions