[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 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}\n"'

will "work" under both UTF-8 and ISO-8859-1. Or you can force UTF-8 with:

perl -CSD -e 'print "\x{00a3}\n"'

You can also do that globally with the PERL_UNICODE environment variable.

Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Reply to: