From 746fc125baa295111f5e72a6141540ea69ca4551 Mon Sep 17 00:00:00 2001 From: Deepak Singh Date: Mon, 13 Apr 2026 09:32:14 +0000 Subject: [PATCH] fix: use runes instead of codeUnits in AhoCorasick search to support emoji and multi-byte characters --- lib/src/aho_corasick.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/aho_corasick.dart b/lib/src/aho_corasick.dart index 9294d6a..6f8f866 100644 --- a/lib/src/aho_corasick.dart +++ b/lib/src/aho_corasick.dart @@ -56,7 +56,7 @@ class AhoCorasick { final matches = >{}; TrieNode? current = _root; final textLower = text.toLowerCase(); - final units = textLower.codeUnits; + final units = textLower.runes.toList(); for (int i = 0; i < units.length; i++) { final rune = units[i];