From 7c09667c55ad26d0f46530261705861100880a23 Mon Sep 17 00:00:00 2001 From: Izumi Raine <63145238+IzumiRaine@users.noreply.github.com> Date: Sat, 3 Apr 2021 20:21:56 +0200 Subject: [PATCH] Add function compatibility_case_fold_str --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5dba244..0192244 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,6 +59,10 @@ pub fn canonical_caseless_match_str(a: &str, b: &str) -> bool { a.chars().canonical_caseless_match(b.chars()) } +pub fn compatibility_case_fold_str(s: &str) -> String { + s.nfd().default_case_fold().nfkd().default_case_fold().nfkd().collect() +} + pub fn compatibility_caseless_match_str(a: &str, b: &str) -> bool { a.chars().compatibility_caseless_match(b.chars()) }