rtl-flip-detect 0.1.0

Detect right-to-left override (U+202E) and other bidi-control characters that flip rendering of strings. Used in filename-spoof and prompt-injection attacks. Zero deps.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# rtl-flip-detect

[![crates.io](https://img.shields.io/crates/v/rtl-flip-detect.svg)](https://crates.io/crates/rtl-flip-detect)

Detect bidi-control characters (U+202A–U+202E, U+2066–U+2069) that flip
rendered direction. Catches `evil\u{202E}cod.exe` filename-spoof and
similar tricks inside LLM tool args.

```rust
use rtl_flip_detect::{has_rtl_flip, strip_rtl_flips};
let s = "evil\u{202E}cod.exe";
assert!(has_rtl_flip(s));
assert_eq!(strip_rtl_flips(s), "evilcod.exe");
```

Zero deps. MIT or Apache-2.0.