From: Chris Hanson Date: Wed, 29 Mar 2017 04:52:44 +0000 (-0700) Subject: Normalize strings prior to hashing so equivalent sequences hash the same. X-Git-Tag: mit-scheme-pucked-9.2.12~158^2~65 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=dc80c76d803b1e729aa58a7f802a1bc4d35106b4;p=mit-scheme.git 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. --- 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))))