in reply to Re^2: CR-LF Newlines as 2 distinct characters
in thread CR-LF Newlines as 2 distinct characters
Ah, I see. I don't know what you need to "mangle", exactly, but since you seem to have UTF16-like representations of purely 8-bit chars, you might take a risk and do s[\x00(?<!\x00)][]gs; on the way in (0) to make a "real ASCII" string. You can then mangle the 8-bit ASCII string comfortably.
Then do something like this on the way out:
$str = join( '', map{ "\x00$_" } split('',$str) );
That should pad you appropriately. It's cheating, but it might work.
[0]: The negative lookbehind is to make sure a "\x00\x00" doesn't get chopped away; it's untested, though.
|
|---|