From: Chris Hanson Date: Sat, 22 Apr 2017 07:17:19 +0000 (-0700) Subject: Move NFC marking from canonical-composition to string->nfc. X-Git-Tag: mit-scheme-pucked-9.2.12~158^2~17 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f96712ee78c1ba81d5eb77567880390d4f74563d;p=mit-scheme.git Move NFC marking from canonical-composition to string->nfc. --- diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index 6e364812a..4acf9bff8 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -893,13 +893,16 @@ USA. (ustring-in-nfc! result) result)) (else - (canonical-composition - (if (string-in-nfd? string) - string - (canonical-decomposition&ordering string - (lambda (string* n max-cp) - (declare (ignore n max-cp)) - string*))))))) + (let ((result + (canonical-composition + (if (string-in-nfd? string) + string + (canonical-decomposition&ordering string + (lambda (string* n max-cp) + (declare (ignore n max-cp)) + string*)))))) + (ustring-in-nfc! result) + result)))) (define (string->nfc-cf string) (string->nfc (string-foldcase string))) @@ -1051,9 +1054,7 @@ USA. (else (string-ref (vector-ref sv fc-index) m))))))))) (scan-for-first-char 0) - (let ((result (builder))) - (ustring-in-nfc! result) - result))) + (builder))) (define-integrable jamo-leading-start #x1100) (define-integrable jamo-leading-end #x1113)