Skip to main content

is_zero_width

Function is_zero_width 

Source
pub fn is_zero_width(ch: char) -> bool
Expand description

Return true if ch is a zero-width or Unicode formatting character commonly used to obfuscate prompt content.

The set is a subset of the Unicode “formatting / joining” category plus a handful of BOM/LRM/RLM codepoints; it is not exhaustive but covers the characters that appear in observed injection payloads.