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

Re: on the almost impossibility to write correct XS modules

Thread Previous | Thread Next
Reini Urban
May 16, 2008 05:45
Re: on the almost impossibility to write correct XS modules
Message ID:
2008/5/16 Jan Dubois <>:
> On Thu, 15 May 2008, Marc Lehmann wrote:
>> On Wed, May 14, 2008 at 11:55:40PM +0200, demerphq <> wrote:
>> From what I saw, however, filename handling on win32 is broken beyond
>> repair, as much of the win32 code overloads the utf-8 flag with the
>> additional meaning "unicode encoded, not ansi codepage" (see for example
>> almost all functions dealing with paths in Win32.xs).
> Why is this beyond repair? The problem of course is that Perl on Windows
> assumes that strings without the utf-8 flag are encoded with Latin-1
> 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?

To me the Win32 attempts also sounds fine, and I'm using it as template for
the upcoming wide char support within cygwin-1.7.

I make the same assumptions as the Win32 port, so we have to handle
the native IO with wchar_t * and the whole mb(=utf8)<->wide enchilada quirks.
Reini Urban

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