From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: `decode-coding-string' question Date: Wed, 5 Jul 2006 19:11:45 +0300 Message-ID: <200607051911.45299.pogonyshev@gmx.net> References: <200607040035.01379.pogonyshev@gmx.net> <200607041831.18435.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1152115916 19961 80.91.229.2 (5 Jul 2006 16:11:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Jul 2006 16:11:56 +0000 (UTC) Cc: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 05 18:11:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fy9yi-0003uQ-Rt for ged-emacs-devel@m.gmane.org; Wed, 05 Jul 2006 18:11:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fy9yi-0002nB-34 for ged-emacs-devel@m.gmane.org; Wed, 05 Jul 2006 12:11:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fy9yT-0002m9-5v for emacs-devel@gnu.org; Wed, 05 Jul 2006 12:11:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fy9yQ-0002lH-EC for emacs-devel@gnu.org; Wed, 05 Jul 2006 12:11:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fy9yQ-0002lE-9D for emacs-devel@gnu.org; Wed, 05 Jul 2006 12:11:34 -0400 Original-Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1Fy9yP-0000hD-TD for emacs-devel@gnu.org; Wed, 05 Jul 2006 12:11:34 -0400 Original-Received: (qmail invoked by alias); 05 Jul 2006 16:11:30 -0000 Original-Received: from dialup.194.158.192.53.belpak.by (EHLO dialup.194.158.192.53.belpak.by) [194.158.192.53] by mail.gmx.net (mp025) with SMTP; 05 Jul 2006 18:11:30 +0200 X-Authenticated: #16844820 Original-To: emacs-devel@gnu.org User-Agent: KMail/1.7.2 In-Reply-To: Content-Disposition: inline X-Y-GMX-Trusted: 0 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:56574 Archived-At: Kenichi Handa wrote: > In article <200607041831.18435.pogonyshev@gmx.net>, Paul Pogonyshev writes: >=20 > > Bad. OK, here is my task: I have a C string in the sources, possibly > > containing encoded characters, like >=20 > > "foo bla \xc2\xa9", >=20 > > the last thing being the UTF-8 copyright characters. I want to > > decode the string (can do that) _and_ know where particular > > characters begin. Currently I set text property `point' on character > > beginnings, but `decode-coding-string' eats them :( Can anyone see a > > different solution, maybe ugly if nothing else? (Except that custom > > implementation of `decode-coding-string' doesn't count as a solution > > ;) >=20 > Why don't you find paticular characters in the decoded > string? I do. But I need to know where they begin in the buffer (containing the encoded C string.) I don't see a way to keep this information at present... :( =46or instance, if the buffer only contains "\xc2\xa9foo", I'd like to receive a string with the following text properties: #("=A9foo" 0 1 (point 0) 1 2 (point 8) 2 3 (point 9) 3 4 (point 10)) The first characters actually takes 8 characters in the buffer! Paul