Function encoding_rs::mem::is_utf8_bidi [−][src]
pub fn is_utf8_bidi(buffer: &[u8]) -> bool
Checks whether a potentially-invalid UTF-8 buffer contains code points that trigger right-to-left processing.
The check is done on a Unicode block basis without regard to assigned vs. unassigned code points in the block. Additionally, the four RIGHT-TO-LEFT FOO controls in General Punctuation are checked for. Control characters that are technically bidi controls but do not cause right-to-left behavior without the presence of right-to-left characters or right-to-left controls are not checked for.
Returns true
if the input is invalid UTF-8 or the input contains an
RTL character. Returns false
if the input is valid UTF-8 and contains
no RTL characters.