diff lisp/unicode.el @ 2633:b921e3d0ac3e

[xemacs-hg @ 2005-03-04 21:59:42 by aidan] Add encode-char and decode-char functions, for wider Mule compatibility. They do unicode-to-char and char-to-unicode, and are implemented in Mule-UCS and GNU Emacs.
author aidan
date Fri, 04 Mar 2005 21:59:43 +0000
parents e71117a6ddac
children d1754e7f0cea
line wrap: on
line diff
--- a/lisp/unicode.el	Thu Mar 03 22:51:13 2005 +0000
+++ b/lisp/unicode.el	Fri Mar 04 21:59:43 2005 +0000
@@ -304,6 +304,20 @@
    little-endian t
    need-bom t))
 
+(defun decode-char (quote-ucs code &optional restriction) 
+  "FSF compatibility--return Mule character with Unicode codepoint `code'.
+The second argument must be 'ucs, the third argument is ignored.  "
+  (assert (eq quote-ucs 'ucs) 
+	  "Sorry, decode-char doesn't yet support anything but the UCS.  ")
+  (unicode-to-char code))
+
+(defun encode-char (char quote-ucs &optional restriction)
+  "FSF compatibility--return the Unicode code point of `char'.
+The second argument must be 'ucs, the third argument is ignored.  "
+  (assert (eq quote-ucs 'ucs)
+	  "Sorry, encode-char doesn't yet support anything but the UCS.  ")
+  (char-to-unicode char))
+
 ;; #### UTF-7 is not yet implemented, and it's tricky to do.  There's
 ;; an implementation in appendix A.1 of the Unicode Standard, Version
 ;; 2.0, but I don't know its licensing characteristics.