develooper Front page | perl.perl5.porters | Postings from March 2007

use encoding

Thread Next
From:
Juerd Waalboer
Date:
March 3, 2007 15:45
Subject:
use encoding
Message ID:
20070303234411.GC4723@c4.convolution.nl
Again re unicode documentation,

"use encoding" causes a lot of confusion, because of some severe
caveats, and I always advise people to avoid using it

However, many PODs refer to it. I think that's a huge problem.

* encoding.pm assumes that the environment of the programmer, equals
that of the end user: STDIO and source code use the same encoding.

* encoding.pm alters interpretation of \x: it makes it hard
(impossible?) to use a character that is in latin1, but not in the
specified encoding.

* encoding.pm makes every string literal internally UTF8 encoded, which
means that $jpeg_image_data."" upgrades $jpeg_image_data, assuming it
was latin1 before.

I see several possible solutions.

* encoding.pm is fixed (can this be done? Who can do this?)

* encoding.pm is documented as broken, or at least gets even more
caveats listed.

In both cases, I think it would help if we removed a lot of references
to encoding.pm; it's currently just too dangerous. Let it stay there for
compatibility/historic reasons, but try to avoid that new users start
using it.

But before I do something huge like remove all (almost all) references
to encoding.pm from other pods, I'd like to know if there's any plan for
encoding.pm already.

Cheers,
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <juerd@juerd.nl>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <sales@convolution.nl>

Ik vertrouw stemcomputers niet.
Zie <http://www.wijvertrouwenstemcomputersniet.nl/>.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About