From dc80c76d803b1e729aa58a7f802a1bc4d35106b4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 28 Mar 2017 21:52:44 -0700 Subject: [PATCH] Normalize strings prior to hashing so equivalent sequences hash the same. I've arbitrarily chosen NFD because its faster than NFC, but a case could be made that NFC is preferable. --- src/runtime/ustring.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index 073380e10..af79646ce 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -1598,7 +1598,7 @@ USA. string)) (define (string-hash string #!optional modulus) - (let ((string* (string-for-primitive string))) + (let ((string* (string-for-primitive (string->nfd string)))) (if (default-object? modulus) ((ucode-primitive string-hash) string*) ((ucode-primitive string-hash-mod) string* modulus)))) -- 2.25.1