From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: string-as-unibyte Date: Tue, 19 Jul 2005 11:56:37 +0900 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1121742920 1779 80.91.229.2 (19 Jul 2005 03:15:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Jul 2005 03:15:20 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 19 05:15:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DuiZN-0000Fk-P2 for ged-emacs-devel@m.gmane.org; Tue, 19 Jul 2005 05:14:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DuibL-0000QZ-KN for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2005 23:16:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DuiXz-0007qZ-Hz for emacs-devel@gnu.org; Mon, 18 Jul 2005 23:13:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DuiXq-0007n8-Ne for emacs-devel@gnu.org; Mon, 18 Jul 2005 23:13:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DuiXk-0007eb-R7 for emacs-devel@gnu.org; Mon, 18 Jul 2005 23:13:19 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DuiQl-0001AS-Nl for emacs-devel@gnu.org; Mon, 18 Jul 2005 23:06:04 -0400 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j6J2uc86014617; Tue, 19 Jul 2005 11:56:38 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j6J2ucCq028737; Tue, 19 Jul 2005 11:56:38 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1DuiHd-0008RZ-00; Tue, 19 Jul 2005 11:56:37 +0900 Original-To: YAMAMOTO Mitsuharu In-reply-to: (message from YAMAMOTO Mitsuharu on Tue, 19 Jul 2005 07:41:33 +0900) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41061 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41061 In article , YAMAMOTO Mitsuharu writes: >>>>>> On Mon, 18 Jul 2005 17:33:02 -0400, Stefan Monnier said: >> Could you explain the need for the change below: >> 2005-07-16 YAMAMOTO Mitsuharu >> * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): >> Use Fstring_as_unibyte instead of string_make_unibyte. > It is at the preparation stage of code conversion. So I think the > following comment in decode_coding_string (coding.c) is also > applicable to this case. > if (STRING_MULTIBYTE (str)) > { > /* Decoding routines expect the source text to be unibyte. */ > str = Fstring_as_unibyte (str); If a multibyte string is given to mac-code-convert-string, and the string is made mutlibyte by string-to-multibyte from the raw-byte sequence (ex. inserting a file by raw-text in a mutlibyte buffer and extracting a string by buffer-substring), using Fstring_as_unibyte is correct. Please note that we don't have Fstring_to_unibyte because it should work the same way as Fstring_as_unibyte. --- Kenichi Handa handa@m17n.org