Re: Interpretation of non-UTF8 strings

[email protected] (Marcin 'Qrczak' Kowalczyk)
Newsgroups perl.unicode
Message-ID <1092665048.19848.562.camel@qrnik>
W liście z pon, 16-08-2004, godz. 16:54 +0300, Jarkko Hietaniemi
napisał:

> > The encoding pragma partially works. It doesn't influence assumed
> > encoding of files opened without specifying the encoding, nor handling
> > of filenames, and it needs to be told about the encoding literally.
> > How to say it should be taken from the locale?
> 
> The 'use open ":locale"' does not work for you?

[qrczak ~]$ echo ąćę >1
[qrczak ~]$ perl -e 'use open ":locale"; open F, "1"; print <F>'
ąćę
[qrczak ~]$ perl -Mencoding=latin2 -e 'use open ":locale"; open F, "1"; print <F>'
"\x{66a8a}" does not map to iso-8859-2 at -e line 1, <F> line 1.

Also, 'use encoding' must still have the encoding specified literally,
it can't be taken from the locale (I can live with that in the case of
the Kogut <-> Perl bridge, as I can just put the encoding there because
I determine it myself anyway), and neither fixes handling of filenames.

-- 
   __("<         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.