[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: decode-coding-string question
From: |
Eli Zaretskii |
Subject: |
Re: decode-coding-string question |
Date: |
Fri, 15 Aug 2008 10:37:59 +0300 |
> From: Dmitry Dzhus <dima@sphinx.net.ru>
> Date: Fri, 15 Aug 2008 02:19:11 +0400
>
> Ted Zlatanov wrote:
>
> > This should decode to нуль but doesn't (I get the same string instead):
> >
> > (decode-coding-string "íîëü" 'cp1251)
> >
> > Am I missing something obvious? Do I need to encode the string to
> > something else?
>
> 0. «íóëü», not «íîëü»
That's not important, the original problem remains, even with a
different spelling of the word.
> 1. (decode-coding-string (string-make-unibyte "íóëü") 'cp1251)
Yes, that's it: decode-coding-string works reliably only on unibyte
strings. In multibyte strings, random byte values will be interpreted
according to rules that are appropriate for Emacs internal
representation of text in buffers and strings, not according to what
we humans expect.
- decode-coding-string question, Ted Zlatanov, 2008/08/14
- Re: decode-coding-string question, Dmitry Dzhus, 2008/08/14
- Re: decode-coding-string question,
Eli Zaretskii <=
- Re: decode-coding-string question, Ted Zlatanov, 2008/08/15
- Re: decode-coding-string question, Eli Zaretskii, 2008/08/15
- Message not available
- Re: decode-coding-string question, Ted Zlatanov, 2008/08/18
- Re: decode-coding-string question, David Golden, 2008/08/18
- Re: decode-coding-string question, Eli Zaretskii, 2008/08/18
- Re: decode-coding-string question, Kevin Rodgers, 2008/08/19
- Message not available
- Re: decode-coding-string question, Ted Zlatanov, 2008/08/18
- Re: decode-coding-string question, David Golden, 2008/08/18
- Re: decode-coding-string question, Ted Zlatanov, 2008/08/19
- Re: decode-coding-string question, Nikolaj Schumacher, 2008/08/19