;;; ucs-normalize.el --- Unicode normalization NFC/NFD/NFKD/NFKC
-;; Copyright (C) 2009
+;; Copyright (C) 2009, 2010
;; Free Software Foundation, Inc.
;; Author: Taichi Kawabata <kawabata.taichi@gmail.com>
;;; Commentary:
;;
-;; This program has passed the NormalizationTest-5.1.0.txt.
+;; This program has passed the NormalizationTest-5.2.0.txt.
;;
;; References:
;; http://www.unicode.org/reports/tr15/
;;; Code:
-(defconst ucs-normalize-version "1.1")
+(defconst ucs-normalize-version "1.2")
(eval-when-compile (require 'cl))
#x1D1BF #x1D1C0)
"Composition Exclusion List.
This list is taken from
- http://www.unicode.org/Public/UNIDATA/CompositionExclusions-5.1.0.txt")
+ http://www.unicode.org/Public/UNIDATA/5.2/CompositionExclusions.txt")
;; Unicode ranges that decompositions & combinings are defined.
(defvar check-range nil)
- (setq check-range '((#x00a0 . #x3400) (#xA600 . #xAC00) (#xF900 . #x10fff) (#x1d000 . #x1dfff) (#x2f800 . #x2faff)))
+ (setq check-range '((#x00a0 . #x3400) (#xA600 . #xAC00) (#xF900 . #x110ff) (#x1d000 . #x1dfff) (#x1f100 . #x1f2ff) (#x2f800 . #x2faff)))
;; Basic normalization functions
(defun nfd (char)
(ucs-normalize-make-translation-table-from-alist (eval-when-compile hfs-nfd-alist)))
(defun ucs-normalize-sort (chars)
- "Sort by canonical combining class of chars."
+ "Sort by canonical combining class of CHARS."
(sort chars
(lambda (ch1 ch2)
(< (ucs-normalize-ccc ch1) (ucs-normalize-ccc ch2)))))
&optional composition-predicate)
"Quick-Check List for DECOMPOSITION-TRANSLATION and COMPOSITION-PREDICATE.
It includes Singletons, CompositionExclusions, and Non-Starter
-decomposition. "
+decomposition."
(let (entries decomposition composition)
(mapc
(lambda (start-end)
(defun ucs-normalize-hfs-nfd-pre-write-conversion (from to)
(let ((old-buf (current-buffer)))
(set-buffer (generate-new-buffer " *temp*"))
- (if (stringp from)
+ (if (stringp from)
(insert from)
(insert-buffer-substring old-buf from to))
(ucs-normalize-HFS-NFD-region (point-min) (point-max))