# encoding_rs::mem::check_utf16_for_latin1_and_bidi - Rust
API documentation for the Rust `check_utf16_for_latin1_and_bidi` fn in crate `encoding_rs`.
Keywords: rust, rustlang, rust-lang, check_utf16_for_latin1_and_bidi

# [−] [src] Function encoding_rs::mem::check_utf16_for_latin1_and_bidi

    pub fn check_utf16_for_latin1_and_bidi(buffer: &[u16]) -> Latin1Bidi

Checks whether a potentially invalid UTF-16 buffer contains code points that trigger right-to-left processing or is all-Latin1.

Possibly more efficient than performing the checks separately.

Returns `Latin1Bidi::Latin1` if `is_utf16_latin1()` would return `true`. Otherwise, returns `Latin1Bidi::Bidi` if `is_utf16_bidi()` would return `true`. Otherwise, returns `Latin1Bidi::LeftToRight`.