Re: utf-8 issue?

"Bill Cole" <[email protected]> Thu, 14 Dec 2017 17:26:38 -0500
Newsgroups gmane.mail.mimedefang
Message-ID <[email protected]>
On 14 Dec 2017, at 9:14 (-0500), Dianne Skoll wrote:

> On Wed, 13 Dec 2017 20:37:36 -0500
> "Bill Cole" <[email protected]> wrote:
>
>> -    return IO::File->new(\ $self->{MBS_Data}, $mode);
>> +    return IO::Scalar->new(\ $self->{MBS_Data}, $mode);
>
> This will cause other problems down the line.  I suggest you
> study the section "Byte and Character Semantics" in the perlunicode
> man page.

Thanks for the reference and for your patience with my confusion. I 
understand much better now: anything expressed as a string has to make 
sense as a series of encoded characters, not a series of bytes.

And as `strings PerlIO/scalar/scalar.bundle` says: "Strings with code 
points over 0xFF may not be mapped into in-memory file handles"

> Modern Perl does let you open a "file" by passing a reference
> to a scalar; it has built-in in-memory I/O.

Indeed. I was fooled by the fact that deep inside the 'open' call stack, 
both $! and $^E get set to "No such file or directory" but that's 
because XSLoader looks for a .bs while loading PerlIO::scalar...

I couldn't find exactly where the "Invalid Argument" error (and matching 
numeric errno) is being generated, since it's in a debug-resistant 
return that pops 4 stack layers in one step, but I'm perfectly happy to 
believe that it's buried in PerlIO/scalar/scalar.bundle and is entirely 
proper.

-- 
Bill Cole
[email protected] or [email protected]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steady Work: https://linkedin.com/in/billcole
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang