APPROVE COMMIT
NOTE: This patch has been committed.
If anyone is preparing a substantial Mule merge with the FSF, shout up, and
I’ll revert this, and leave it to you. Otherwise, this should help, and a
general Mule merge is not at the moment a big priority for me, and won’t be
for a while.
decode-char and encode-char are also in Mule-UCS.
lisp/ChangeLog addition:
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.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: lisp/unicode.el
Index: lisp/unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/unicode.el,v
retrieving revision 1.11
diff -u -u -r1.11 unicode.el
--- lisp/unicode.el 2005/02/09 15:29:07 1.11
+++ lisp/unicode.el 2005/03/04 21:56:28
@@ -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.
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien
Show replies by date