Skip to main content

check_valid_utf8

Function check_valid_utf8 

Source
pub fn check_valid_utf8(bytes: &[u8]) -> Result<(), ErrorData>
Expand description

Checks whether bytes form a valid UTF-8 string according to DuckDB’s validator (DuckDB 1.5.0+).

DuckDB enforces stricter rules than Rust in some cases (e.g. rejecting certain code points), so this is useful when validating externally-sourced bytes before handing them to DuckDB string APIs.

§Errors

Returns the structured ErrorData describing the first validation failure.