I have a new module, PerlIO::locale,
on CPAN. It's a trivial piece of DWIM -- a subclass of PerlIO::encoding
that guesses the encoding from the current locale. However, there are a
couple of interesting points:
- It's statically linked with encoding.so, to correctly get
pointers on the internal PerlIO functions defined by it. Better ideas
welcome.
- It has no tests. (Well, it has one test: use_ok.) It's
typically difficult to write portable tests for this kind of modules, without
knowing which locales are available on the tester's machine, then switching
locales appropriately, etc. I'll have to figure out a way to do it without
being too tired.