Re: Converting a Mule character to UCS code point
"Stephen J. Turnbull" <[email protected]> Thu, 16 Oct 2003 13:00:28 +0900
| Newsgroups | gmane.emacs.xemacs.mule |
|---|---|
| Organization | The XEmacs Project |
| Message-ID | <[email protected]> |
>>>>> "Hrvoje" == Hrvoje Niksic <[email protected]> writes: Hrvoje> * char-ucs, a built-in. Whatever I do, (char-ucs CHAR) Hrvoje> returns nil. FSF doesn't have it. Apparently unusable or Hrvoje> unfinished. This works in 21.5. I don't know what it's defined as in 21.4; since we have no Unicode tables built-in, it can't work without further support. Hrvoje> * char-to-ucs, part of the mule-ucs package This is really the only current option in 21.4. An alternative which would be fast would be to preload tables into C modules (these could be automatically generated by Lisp programs in 21.5; I use this approach for latin-unity, for example). It might require some changes to 21.4 core (ie, if char-cus is purely a stub, we'd have to implement it), in which case we'd need Vin's approval. Probably the way to go in that case is to remove char-ucs from 21.4 core and implement it as a module. I don't know if we can override existing functions from a module (bad practice, of course, but if the user can't/won't upgrade, what else is there?) mule-ucs is deprecated, orphaned, and available only because there's no reasonable way to get Unicode support in 21.4. Hrvoje> * encode-char, also part of the mule-ucs package, and also Hrvoje> present in FSF. The interface is a bit weird Hrvoje> (`(encode-char CHAR 'ucs)'), but it seems to work Hrvoje> correctly. Dunno about this. It's not weird to me. Presumably you can do that for any charset and get the external code point. Hrvoje> Can any of these be considered stable? char-ucs is, although if GNU Emacs is standardizing on encode-char, I guess we have to turn around and piss with the wind. You should ask Handa and/or Love. Here's a trivial restriction of the encode-char interface for 21.5: (unless (fboundp 'encode-char) (defun encode-char (ch charset) (if (eq charset 'ucs) (char-ucs ch) (error 'wrong-type-argument "encode-char only supports ucs" charset)))) -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.