[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Internal coding system - Need advice 22 v. 23
From: |
Kenichi Handa |
Subject: |
Re: Internal coding system - Need advice 22 v. 23 |
Date: |
Wed, 11 Nov 2009 15:55:02 +0900 |
In article <address@hidden>, Sebastian Rose <address@hidden> writes:
> To send unicode text to emacs via org-protocol, I wrote a function, that
> decodes all those hex-encoded characters (e.g. `%C3%B6' is the German
> Umlaut `ΓΌ'). That function `org-protocol-unhex-string' is defunned in
> org/lisp/org-protocol.el. It works perfectly for emacs-23.
> For emacs-22 this does _not_ work, however.
> The problem occurs, if `char-to-string' is called with an unicode
> character. E.g.
> (char-to-string 8211)
> perfectly returns a dash in emacs-23. `org-protocol-unhex-string' works
> like a charme for texts like those on http://www.welcome2japan.cn/ - in
> emacs-23.
Emacs-23's character code is a superset of Unicode, but
Emacs-22's character code is not compatible with Unicode.
To get Emacs-22's character code from Unicode character
code, you must use decode-char function. For instance, the
above should be done by (string (decode-char 'ucs 8211)).
And please note that Emacs-22 supports just a subset of
Unicode (U+0000..U+33FF, U+E000..U+FFFF, and some of CJK
characters contained in such legacy charsets as JISX0208,
GB2312, KSC5601).
---
Kenichi Handa
address@hidden