[Top][All Lists]

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

Re: eight-bit char handling in emacs-unicode

From: Stefan Monnier
Subject: Re: eight-bit char handling in emacs-unicode
Date: 22 Nov 2003 18:53:05 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>> It is perfectly possible to live in such an environment
>>> where only the charset iso-8859-1 is used but only the
>>> coding system utf-8 is used.  In this environment, the
>>> results of encode-coding-string and string-make-unibyte are
>>> of course not the same, but still both operations are
>>> meaningful.

>> I see that encode-coding-string does the utf-8 encoding, but what
>> does string-make-unibyte do in such a case and what is it used for ?

> It gets iso-8859-1 code-points of all characters in a
> multibyte string and concatenate them (the same as what is
> does in latin-1 lang. env.).

You mean it does the same as (encode-coding-string str 'latin-1) ?
Then why use string-make-unibyte ?

> Please try C-x C-m L utf-8 RET and see how
> string-make-unibyte and string-make-multibyte work.

I'll try that, but I'd like to understand the motivation for making it work
the way it works.  I've always understood those two as "trying to DTRT" in
a very ad-hoc way such that people that used to work in an 8bit non-ASCII
environment don't need to worry about coding-systems and still have
things working mostly correctly.


reply via email to

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