emacs-devel
[Top][All Lists]
Advanced

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

Re: using empty_string as the only "" string


From: Stefan Monnier
Subject: Re: using empty_string as the only "" string
Date: Wed, 25 Apr 2007 12:07:29 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux)

> For example, if I want to make multibyte "ÀÈ", I would like to use
> (string-to-multibyte (concat "\300" "\310")) => "\xc0\xc8" (why ?)

See the docstring of string-to-multibyte: it's basically equivalent to
(decode-coding-string STRING 'binary).
If you want your unibyte string interpreted as a latin-1 encoded text, then
say so explicitly:

  (decode-coding-string (concat "\300" "\310") 'latin-1)  =>  "ÀÈ"

> (concat (string-as-multibyte "\300") (string-as-multibyte "\310")) =>
> "\xc0\xc8" (why ?)

If you don't know, then please pretty please, stay away from
string-as-multibyte.


        Stefan




reply via email to

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