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: Fri, 7 Jul 2006 19:05:04 +0300
User-agent: KMail/1.7.2

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




reply via email to

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