Re: Interpretation of non-UTF8 strings

[email protected] (Marcin 'Qrczak' Kowalczyk)
Newsgroups perl.unicode
Message-ID <1092668223.19848.590.camel@qrnik>
W liście z pon, 16-08-2004, godz. 15:32 +0100, Nick Ing-Simmons napisał:

> Once we had 
> 
> use encoding qw(locale);
> 
> But it did not work well as not all locale implementations
> give the API to return the encoding.

Yes, authors of C APIs about encodings are to blame; not everyone
supports nl_langinfo(CODESET), and iconv is not everywhere. Anyway,
lib/open.pm tries to guess when it's not available, so the same can be
applied to the encoding pragma.

> (And even en_GB can be in ASCII, 8859-1, 8859-15 (with euro), UTF-8, ...)

If nl_langinfo(CODESET) is available, it will tell the correct encoding
without having to know what en_GB means. I would understand if Perl's
use encoding(locale) doesn't work on systems where it's hard to guess
the locale encoding. Personally I don't care about Unicode on systems
which don't support the necessary standard APIs, but I do care about
ones that do.

-- 
   __("<         Marcin Kowalczyk
   \__/       [email protected]
    ^^     http://qrnik.knm.org.pl/~qrczak/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.