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

=?utf-8?Q?OSes_that_expect_something_besides_bytes_=E2=80=A6?=

From:
Felipe Gasper
Date:
March 3, 2021 01:44
Subject:
=?utf-8?Q?OSes_that_expect_something_besides_bytes_=E2=80=A6?=
Message ID:
49D58289-92B5-4389-8FAC-C96BA971B2F5@felipegasper.com
Hi all,

	I pushed a CPAN module today, Sys::Binmode, that auto-downgrades strings on their way to the OS in ops like exec and require. This works around the use of SvPV_nolen to convert SVs to C strings, achieving predictable output without requiring the Perl application to violate Perl’s internal string-encoding abstraction.

	While in Linux this makes total sense, someone pointed out that in Windows things are more complicated. Sys::Binmode doesn’t break anything in Windows Perl currently, but it apparently *would* break things if Windows Perl switched to functions like CreateDirectoryW rather than CreateDirectoryA, since then we’re not passing byte strings to the OS anymore.

	Now I wonder: which other OSes does Perl support that present such problems?

	Thank you!

cheers,
-Felipe


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