-(defun chise-turtle-format-ccs-code-point (ccs code-point)
- (let ((ccs-uri (chise-turtle-uri-encode-ccs-name ccs)))
- (unless (assoc ccs-uri chise-turtle-ccs-prefix-alist)
- (setq chise-turtle-ccs-prefix-alist
- (cons (cons ccs-uri ccs)
- chise-turtle-ccs-prefix-alist)))
- (format "%s:%s"
- ccs-uri
- (format (charset-code-point-format-spec ccs)
- code-point))))
-
-(defun chise-turtle-encode-char (object)
- (let (spec cell dest
- ccs ret ret2)
- (if (setq ret (encode-char object '=ucs))
- (chise-turtle-format-ccs-code-point '=ucs ret)
- (setq spec (char-attribute-alist object))
- (while (and spec
- (setq cell (pop spec)))
- (if (and (find-charset (car cell))
- (setq ret (cdr cell)))
- (setq dest (cons cell dest))))
- (setq ret (car (sort dest (lambda (a b)
- (char-attribute-name< (car a)(car b)))))
- ccs (car ret)
- ret (cdr ret))
- (cond (ret
- (chise-turtle-format-ccs-code-point ccs ret)
- )
- ((and (setq ccs (car (split-char object)))
- (setq ret (encode-char object ccs)))
- (chise-turtle-format-ccs-code-point ccs ret)
- )
- ((setq ret (get-char-attribute object 'ideographic-combination))
- (format "ideocomb:%s"
- (mapconcat (lambda (cell)
- (cond ((characterp cell)
- (char-to-string cell)
- )
- ((setq ret2 (find-char cell))
- (char-to-string ret2)
- )
- (t
- (format "%S" cell)
- )))
- ret ""))
- )
- (t
- (format (if est-hide-cgi-mode
- "system-char-id=0x%X"
- "system-char-id:0x%X")
- (encode-char object 'system-char-id))
- )))))
-