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

Re: on the almost impossibility to write correct XS modules

Thread Previous | Thread Next
Aristotle Pagaltzis
May 18, 2008 19:50
Re: on the almost impossibility to write correct XS modules
Message ID:
* Marc Lehmann <> [2008-05-17 15:20]:
> On Thu, May 15, 2008 at 04:31:13PM -0700, Jan Dubois <> 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.

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About