(funcall map-unicode-property 'uppercase
(lambda (lc uc) (aset up lc uc) (aset up uc uc)))
(funcall map-unicode-property 'lowercase
- (lambda (uc lc) (aset down uc lc) (aset down lc lc))))))
+ (lambda (uc lc) (aset down uc lc) (aset down lc lc)))
+
+ ;; Override the Unicode uppercase property for ß, since we are
+ ;; using our case tables for determining the case of a
+ ;; character (see uppercasep and lowercasep in buffer.h).
+ ;; The special-uppercase property of ß ensures that it is
+ ;; still upcased to SS per the usual convention.
+ (aset up ?ß ?ẞ))))
;; Clear out the extra slots so that they will be recomputed from the main
;; (downcase) table and upcase table. Since we’re side-stepping the usual
(ert-deftest regexp-eszett ()
"Test matching of ß and ẞ."
+ ;; Sanity checks.
+ (should (equal (upcase "ß") "SS"))
+ (should (equal (downcase "ß") "ß"))
+ (should (equal (capitalize "ß") "Ss")) ; undeutsch...
+ (should (equal (upcase "ẞ") "ẞ"))
+ (should (equal (downcase "ẞ") "ß"))
+ (should (equal (capitalize "ẞ") "ẞ"))
;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu).
(let ((case-fold-search nil))
(should (equal (string-match "ß" "ß") 0))
(should (equal (string-match "ẞ" "ẞ") 0))
(should (equal (string-match "[[:alpha:]]" "ß") 0))
;; bug#11309
- ;;(should (equal (string-match "[[:lower:]]" "ß") 0))
- ;;(should (equal (string-match "[[:upper:]]" "ß") nil))
+ (should (equal (string-match "[[:lower:]]" "ß") 0))
+ (should (equal (string-match "[[:upper:]]" "ß") nil))
(should (equal (string-match "[[:alpha:]]" "ẞ") 0))
(should (equal (string-match "[[:lower:]]" "ẞ") nil))
(should (equal (string-match "[[:upper:]]" "ẞ") 0)))
(should (equal (string-match "ẞ" "ẞ") 0))
(should (equal (string-match "[[:alpha:]]" "ß") 0))
;; bug#11309
- ;;(should (equal (string-match "[[:lower:]]" "ß") 0))
- ;;(should (equal (string-match "[[:upper:]]" "ß") 0))
+ (should (equal (string-match "[[:lower:]]" "ß") 0))
+ (should (equal (string-match "[[:upper:]]" "ß") 0))
(should (equal (string-match "[[:alpha:]]" "ẞ") 0))
(should (equal (string-match "[[:lower:]]" "ẞ") 0))
(should (equal (string-match "[[:upper:]]" "ẞ") 0))))