User: aidan
Date: 05/03/04 22:59:44
Modified: xemacs/lisp ChangeLog unicode.el
Log:
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.
Revision Changes Path
1.650 +10 -0 XEmacs/xemacs/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.649
retrieving revision 1.650
diff -u -r1.649 -r1.650
--- ChangeLog 2005/03/02 21:37:54 1.649
+++ ChangeLog 2005/03/04 21:59:42 1.650
@@ -1,3 +1,13 @@
+2005-03-04 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * unicode.el (decode-char): New. This is what the FSF Mule API
+ calls unicode-to-char. The API of the function is more general,
+ but support for anything beyond Unicode isn't implemented, and I
+ can't see why it would be, given that make-char does a fine job
+ already.
+ * unicode.el (encode-char): New. This is what the FSF Mule calls
+ char-to-unicode.
+
2005-02-28 Simon Josefsson <jas(a)extundo.com>
* about.el (xemacs-hackers): Add jas.
1.12 +14 -0 XEmacs/xemacs/lisp/unicode.el
Index: unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/unicode.el,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- unicode.el 2005/02/09 15:29:07 1.11
+++ unicode.el 2005/03/04 21:59:43 1.12
@@ -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.