Skip to main content

decode_script_bytes

Function decode_script_bytes 

Source
pub fn decode_script_bytes(bytes: &[u8]) -> String
Expand description

Decode raw script bytes into the pipeline’s String form without losing a single byte.

Valid UTF-8 runs are copied verbatim; every byte that is not part of a valid UTF-8 sequence is Meta-encoded so crate::ported::utils::unmetafy_str reproduces it exactly at the output boundary.

A literal U+0083 that was validly UTF-8 encoded in the source (bytes c2 83) is copied through as the char U+0083, matching what Src/input.c:267 shingetline already does on the stdin path; it then reads as a Meta marker, which is the pre-existing ambiguity of the char-level encoding and is not introduced here.