emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `decode-coding-string' question


From: Paul Pogonyshev
Subject: Re: `decode-coding-string' question
Date: Wed, 5 Jul 2006 19:11:45 +0300
User-agent: KMail/1.7.2

Kenichi Handa wrote:
> In article <address@hidden>, Paul Pogonyshev <address@hidden> writes:
> 
> > Bad.  OK, here is my task: I have a C string in the sources, possibly
> > containing encoded characters, like
> 
> >     "foo bla \xc2\xa9",
> 
> > 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
> > ;)
> 
> 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... :(

For instance, if the buffer only contains "\xc2\xa9foo", I'd like
to receive a string with the following text properties:

  #("©foo" 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]