1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Confusable / spoof detection (UTS #39). Requires the `alloc` feature.
use confusables as gen;
use nfd;
use ;
use String;
use Vec;
/// The UTS #39 *confusable skeleton* of `s`: NFD, then replace each character by
/// its confusable prototype, then NFD again. Two strings are visually
/// confusable iff their skeletons are equal — see [`confusable`].
///
/// ```
/// use intl::unicode::spoof::skeleton;
/// // Cyrillic "а" and Latin "a" share a skeleton.
/// assert_eq!(skeleton("pаypal"), skeleton("paypal"));
/// ```
/// `true` if `a` and `b` are confusable (have the same [`skeleton`]) yet are not
/// the same string.
/// `true` if every character of `s` could belong to a single script under
/// `Script_Extensions` resolution (UTS #39 "Single Script"). Characters that are
/// `Common` or `Inherited` are compatible with any script. An empty string is
/// single-script.
///
/// A `false` result flags a mixed-script string — a common spoofing signal.