$l1 = pack 'C0a*', $s; # copies the bytes out of $s and marks the result as non-UTF-8 $u8 = pack 'U0a*', $s; # copies the bytes out of $s and marks the result as UTF-8 -- even if the bytes don't form proper UTF-8 strings!