Skip to main content

builtin_raw_to_char

Function builtin_raw_to_char 

Source
fn builtin_raw_to_char(
    args: &[RValue],
    named: &[(String, RValue)],
) -> Result<RValue, RError>
Expand description

Convert a raw (byte) vector to a character string.

Uses bstr for graceful handling of non-UTF-8 bytes: invalid sequences are replaced with the Unicode replacement character (U+FFFD) rather than producing an error, matching R’s tolerant behavior with rawToChar().

When multiple = TRUE, each byte becomes a separate character element.

@param x raw vector to convert @param multiple logical: if TRUE, return one string per byte (default FALSE) @return character scalar (or vector if multiple=TRUE) containing the string