SvPVX() performs NO COERCIONS WHATSOEVER
I know. It just doesn't necessarily return a pointer to the bytes of a byte string.
I therefore invite you to prove your assertion with code!
Well, I don't know of anything that omits the \0, so the remaining two can be shown using:
my $byte_string = "\x80\x81"; dump_sv_pvx($byte_string); utf8::upgrade($byte_string); dump_sv_pvx($byte_string);
Any function or PerlIO layer is free to do format switch, even if the string only contains bytes. It doesn't change the string at all. It's still the same string of bytes.
You didn't specify where the string came from. Maybe it came from lcss, for example, which can switch the internal format. (You discussed using lcss recently, IIRC.) If you need a specific format (and you do), SvPVX without a preceding format check is buggy.
In reply to Re^18: Interleaving bytes in a string quickly
by ikegami
in thread Interleaving bytes in a string quickly
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |