From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Internal coding system - Need advice 22 v. 23 Date: Wed, 11 Nov 2009 15:55:02 +0900 Message-ID: References: <87pr7pzme8.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257922539 19346 80.91.229.12 (11 Nov 2009 06:55:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 06:55:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Sebastian Rose Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 11 07:55:31 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N8774-0000mL-Vj for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 07:55:31 +0100 Original-Received: from localhost ([127.0.0.1]:33100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8774-0000Xw-HU for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 01:55:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N876v-0000Ur-IS for emacs-devel@gnu.org; Wed, 11 Nov 2009 01:55:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N876p-0000OQ-Cc for emacs-devel@gnu.org; Wed, 11 Nov 2009 01:55:20 -0500 Original-Received: from [199.232.76.173] (port=52999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N876o-0000O6-RS for emacs-devel@gnu.org; Wed, 11 Nov 2009 01:55:14 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:63940) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N876o-0004Nz-19 for emacs-devel@gnu.org; Wed, 11 Nov 2009 01:55:14 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id nAB6t3nH003360; Wed, 11 Nov 2009 15:55:04 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id nAB6t3XC013351; Wed, 11 Nov 2009 15:55:03 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id nAB6t3ou016993; Wed, 11 Nov 2009 15:55:03 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1N876d-0003VY-0u; Wed, 11 Nov 2009 15:55:03 +0900 In-Reply-To: <87pr7pzme8.fsf@gmx.de> (message from Sebastian Rose on Wed, 11 Nov 2009 06:00:15 +0100) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116827 Archived-At: In article <87pr7pzme8.fsf@gmx.de>, Sebastian Rose = 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 `=FC'). 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 handa@m17n.org