From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Rose Newsgroups: gmane.emacs.devel Subject: Re: Internal coding system - Need advice 22 v. 23 Date: Wed, 11 Nov 2009 09:10:29 +0100 Message-ID: <87ljidzdl6.fsf@gmx.de> References: <87pr7pzme8.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257928662 1805 80.91.229.12 (11 Nov 2009 08:37:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 08:37:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 11 09:37:35 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 1N88hp-0005E4-2g for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 09:37:33 +0100 Original-Received: from localhost ([127.0.0.1]:41315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N88ho-0003ua-9g for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 03:37:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N88hi-0003uA-Ed for emacs-devel@gnu.org; Wed, 11 Nov 2009 03:37:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N88he-0003sO-1F for emacs-devel@gnu.org; Wed, 11 Nov 2009 03:37:26 -0500 Original-Received: from [199.232.76.173] (port=58708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N88hd-0003sE-SH for emacs-devel@gnu.org; Wed, 11 Nov 2009 03:37:21 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]:58437) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1N88hd-0002CM-9L for emacs-devel@gnu.org; Wed, 11 Nov 2009 03:37:21 -0500 Original-Received: (qmail invoked by alias); 11 Nov 2009 08:10:38 -0000 Original-Received: from unknown (EHLO beteigeuze.gmx.de) [188.46.69.186] by mail.gmx.net (mp050) with SMTP; 11 Nov 2009 09:10:38 +0100 X-Authenticated: #8529601 X-Provags-ID: V01U2FsdGVkX1/0W6oK9e30/w2VNl6eTgff5DClN+IZtS/hv58fTu zBOwKTJMjezT3K In-Reply-To: (Kenichi Handa's message of "Wed, 11 Nov 2009 15:55:02 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:116828 Archived-At: Kenichi Handa writes: > 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 `=C3=BC'). 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)). Ahh - OK. Seems to work perfect. > 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). Well, there's nothing I could do about it except check for errors and fail. Thanks a lot for this explanation! Best wishes Sebastian