Ian Jackson <ijackson@chiark.greenend.org.uk> writes:
> Klaus Ethgen writes:
>> No, it is not. 00a3 is just not a utf-8 character, it is unicode. To
>> get a correct utf-8 character you need to print x{c2a3} and then
>> isutf8 is happy.
> When LC_CTYPE=en_GB.utf-8, programs which attempt to print unicode
> characters to stdout should use UTF-8. That's what LC_TYPE means.
Perl is specifically documented to not do this for backward compatibility
reasons. In Perl, which is the one I know best, you are required to
decode input and encode output if you want to have UTF-8 handling.
See perlunicode(1). There are a variety of reasons for this that turn out
to be fairly good ones if you don't want to badly break a bunch of
existing Perl scripts that were dealing with, for example, binary data.
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87lj1ijp93.fsf@windlord.stanford.edu">http://lists.debian.org/87lj1ijp93.fsf@windlord.stanford.edu
02-15-2011, 11:09 PM
Vincent Lefevre
OT: Python
On 2011-02-14 13:11:04 -0800, Russ Allbery wrote:
> Perl is specifically documented to not do this for backward compatibility
> reasons. In Perl, which is the one I know best, you are required to
> decode input and encode output if you want to have UTF-8 handling.
Or better, use the -C option.
perl -C -e 'print "x{00a3}
"'
will "work" under both UTF-8 and ISO-8859-1. Or you can force UTF-8 with:
perl -CSD -e 'print "x{00a3}
"'
You can also do that globally with the PERL_UNICODE environment variable.
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110216000924.GM15920@prunille.vinc17.org">http://lists.debian.org/20110216000924.GM15920@prunille.vinc17.org