- (when (and (char= char1 #\e)
- (char= char2 #\combining_acute_accent))
- #\latin_small_letter_e_with_acute))
+ (let ((c1 (char-code char1))
+ (c2 (char-code char2)))
+ (cond
+ ((gethash (dpb (char-code char1) (byte 21 21) (char-code char2))
+ **character-primary-compositions**))
+ ((and (<= #x1100 c1) (<= c1 #x1112)
+ (<= #x1161 c2) (<= c2 #x1175))
+ (let ((lindex (- c1 #x1100))
+ (vindex (- c2 #x1161)))
+ (code-char (+ #xac00 (* lindex 588) (* vindex 28)))))
+ ((and (<= #xac00 c1) (<= c1 #.(+ #xac00 11171))
+ (<= #x11a8 c2) (<= c2 #x11c2)
+ (= 0 (rem (- c1 #xac00) 28)))
+ (code-char (+ c1 (- c2 #x11a7)))))))