From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: `decode-coding-string' question Date: Fri, 7 Jul 2006 19:05:04 +0300 Message-ID: <200607071905.04387.pogonyshev@gmx.net> References: <200607040035.01379.pogonyshev@gmx.net> <200607062334.21288.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152302074 9510 80.91.229.2 (7 Jul 2006 19:54:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Jul 2006 19:54:34 +0000 (UTC) Cc: bug-cc-mode@gnu.org Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Fri Jul 07 21:54:31 2006 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FywP6-00061u-UG for sf-cc-mode-help@m.gmane.org; Fri, 07 Jul 2006 21:54:21 +0200 Original-Received: from sc8-sf-list1-new.sourceforge.net (unknown [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 2B58A12F4D; Fri, 7 Jul 2006 12:54:20 -0700 (PDT) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1FywP4-0003sI-9J for cc-mode-help@lists.sourceforge.net; Fri, 07 Jul 2006 12:54:18 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:RC4-SHA:128) (Exim 4.44) id 1FywP2-0005jE-Ns for cc-mode-help@lists.sourceforge.net; Fri, 07 Jul 2006 12:54:18 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FywP0-0003A0-4E for bug-cc-mode@gnu.org; Fri, 07 Jul 2006 15:54:14 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1FywPQ-0000mg-HP for bug-cc-mode@gnu.org; Fri, 07 Jul 2006 15:54:43 -0400 Original-Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1FywPQ-0000mY-0d for bug-cc-mode@gnu.org; Fri, 07 Jul 2006 15:54:40 -0400 Original-Received: (qmail invoked by alias); 07 Jul 2006 19:54:06 -0000 Original-Received: from dialup.194.158.192.60.belpak.by (EHLO dialup.194.158.192.60.belpak.by) [194.158.192.60] by mail.gmx.net (mp035) with SMTP; 07 Jul 2006 21:54:06 +0200 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org, Eli Zaretskii User-Agent: KMail/1.7.2 In-Reply-To: Content-Disposition: inline X-Y-GMX-Trusted: 0 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on monty-python X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:3554 gmane.emacs.devel:56742 Archived-At: Eli Zaretskii wrote: > > To know what character is encoded by this C sequence, I first translate > > strings "\xc2" and "\xa9" to the appropriate (undecoded!) characters. > > The resulting string of length 2 is encoded in UTF-8 and I decode it > > to receive the copyright character or whatever. > > Why not use `(decode-coding-string "\xc2\xa9" 'utf-8)' right away? It > gives me the right character directly. Because you underquoted the string. It is actually `(decode-coding-string "\\xc2\\xa9" 'utf-8)' and does nothing... > Btw, why don't we have a feature in cc-mode to transparently decode > and encode such strings when the source file is read/written? If > detecting the encoding is an issue, we could for starters ask that > users state that in some file-local variable. Given that it is not easy to decode strings (and quite slow)... Paul Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642