HFS+, the file system formerly used in Apple macOS, uses a unique Unicode normalization similar to NFD.
This library composes or decomposes Unicode code points according to the normalization. e.g.
U+00E9
] de Paris (Common) ⇔ Université[U+0065 U+0301
] de Paris (HFS+)U+30D7
]ル (Common) ⇔ アップ[U+30D5 U+309A
]ル (HFS+)Add this library hfs_nfd
to your Cargo.toml
.
```toml
[dependencies]
anotherlibrary1 = "
hfs_nfd = "0.1.1" # <= Here
```
Then, use these functions:
```rust use hfsnfd::{composefromhfsnfd,decomposeintohfs_nfd}
asserteq!(decomposeintohfsnfd("Universit\u{00E9}"), "Universite\u{0301}".tostring()); asserteq!(composefromhfsnfd("アッフ\u{309A}ル"), "アッ{30D7}ル".tostring()); ```
In HFS+, Korean Hangul characters are also composed or decomposed in the way other than what is listed on the table.
In addition, the Korean Hangul characters with codes in the range u+AC00 through u+D7A3 are illegal and must be replaced with the equivalent sequence of conjoining jamos, as described in the Unicode 2.0 book, section 3.10.
I've not implemented it yet.
Please don't hasitate to send a PR on this if you feel inconvenience. These pages may be help you: