From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: unibyte<->multibyte conversion [Re: Emacs-diffs Digest, Vol 2, Issue 28] Date: Tue, 21 Jan 2003 09:10:07 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301210010.JAA17551@etlken.m17n.org> References: <3405-Sat18Jan2003154003+0200-eliz@is.elta.co.il> <200301200229.LAA16287@etlken.m17n.org> <6480-Mon20Jan2003214849+0200-eliz@is.elta.co.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1043108349 28322 80.91.224.249 (21 Jan 2003 00:19:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 21 Jan 2003 00:19:09 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18am8B-0007MY-00 for ; Tue, 21 Jan 2003 01:19:07 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18amJI-0003HF-00 for ; Tue, 21 Jan 2003 01:30:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18am8c-0005zb-03 for emacs-devel@quimby.gnus.org; Mon, 20 Jan 2003 19:19:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18am7p-0005WZ-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 19:18:45 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18am7l-0005Uv-00 for emacs-devel@gnu.org; Mon, 20 Jan 2003 19:18:42 -0500 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18alza-0000WX-00; Mon, 20 Jan 2003 19:10:15 -0500 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h0L0A7k03078; Tue, 21 Jan 2003 09:10:07 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h0L0A7R06979; Tue, 21 Jan 2003 09:10:07 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id JAA17551; Tue, 21 Jan 2003 09:10:07 +0900 (JST) Original-To: eliz@is.elta.co.il In-reply-to: <6480-Mon20Jan2003214849+0200-eliz@is.elta.co.il> User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) Original-cc: rms@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10919 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10919 In article <6480-Mon20Jan2003214849+0200-eliz@is.elta.co.il>, "Eli Zaretski= i" writes: >> On process reading, if raw-text is used, the process output >> is at first read as a unibyte string, the string is coverted >> to multibyte by string-as-mulitbyte (not by not-yet-existing >> string-to-multibyte), then inserted in a multibyte buffer. > Sorry, I don't think I understand the difference. What will we have > in the buffer after process output is converted as you describe in the > last paragraph above? Ok, here's an example (Latin-1 lang. env.). unibyte sequence (hex): 81 81 C0 C0 result of conversion display in multbyte buffer string-as-multibyte: 9E A1 81 C0 C0 \201=C0\300 string-make-multibyte: 9E A1 9E A1 81 C0 81 C0 \201\201=C0=C0 string-to-multibyte: 9E A1 9E A1 C0 C0 \201\201\300\300 (1) Reading a process output by raw-text into a multibyte buffer does AS conversion. I think this should do TO conversion to be consistent with (3). (2) Reading a file by raw-text (resulting in a unibyte buffer) and copying the contents into a multibyte buffer does MAKE conversion. This is Emacs' default unibyte->multibyte conversion. (3) Inserting a file by raw-text in a multibyte buffer does TO conversion. --- Ken'ichi HANDA handa@m17n.org