develooper Front page | perl.perl5.porters | Postings from May 2008

Re: on the almost impossibility to write correct XS modules

From:
Aristotle Pagaltzis
Date:
May 18, 2008 19:50
Subject:
Re: on the almost impossibility to write correct XS modules
Message ID:
20080519025042.GM6738@klangraum.plasmasturm.org
* Marc Lehmann <schmorp@schmorp.de> [2008-05-17 15:20]:
> On Thu, May 15, 2008 at 04:31:13PM -0700, Jan Dubois <jand@activestate.com> wrote:
> > encoding whereas they really are ANSI encoded. So once the
> > automatic upgrading assumes ANSI encoding instead of Latin-1,
> > everything should be working correctly, no?
> 
> Uhm.... that one can even suggest such brokenness :)
> 
> Of course basically everything will break, you mean, because
> the assumption that its not latin1 of course breaks roughly all
> code dealing with unicode in perl, which doesn't expect that
> perl suddenly uses ANSI instead of unicode codepoints (they
> differ!).

Backtracking a bit here, why would this break anything? For
strings coming out of the Win32 API, immediately decode them to
characters; for strings going in, upgrade them to characters if
necessary, then encode them to ANSI at the last moment.

That way, no one ever needs to care that filenames are in ANSI,
because as far as Perl code is concerned it always gets them as
character strings.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



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