Re: Interpretation of non-UTF8 strings

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

> > [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.
> 
> You probably need
> 
> perl -Mencoding=latin2 -C -e 'use open ":locale"; open F, "1"; print <F>'
> 
> With Perl 5.8.1 in SunOS 8 with LC_ALL set to pl_PL.ISO8859-2 I get
> "ąćę" (0xb1 0xe6 0xea) with that.  I have to admit that needing the -C
> smells like a bug, I'll investigate.

Works, thanks. What is weird, with use open ":encoding(latin2)"
it works without -C but doesn't work *with* -C, complaining about
wide character in print at -e line 1, <F> line 1.

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