From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: setenv -> locale-coding-system cannot handle ASCII?! Date: Tue, 25 Feb 2003 21:11:19 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200302260211.h1Q2BJl08373@rum.cs.yale.edu> References: <200302250634.PAA27478@etlken.m17n.org> <200302260058.JAA28973@etlken.m17n.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046225545 2212 80.91.224.249 (26 Feb 2003 02:12:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 26 Feb 2003 02:12:25 +0000 (UTC) Cc: miles@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 18nr3X-0000ZY-00 for ; Wed, 26 Feb 2003 03:12:23 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18nrJk-00011O-00 for ; Wed, 26 Feb 2003 03:29:08 +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 18nr3i-0007oC-00 for emacs-devel@quimby.gnus.org; Tue, 25 Feb 2003 21:12:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18nr3D-0007mn-00 for emacs-devel@gnu.org; Tue, 25 Feb 2003 21:12:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18nr3B-0007mM-00 for emacs-devel@gnu.org; Tue, 25 Feb 2003 21:12:02 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18nr2Z-0007RC-00; Tue, 25 Feb 2003 21:11:23 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h1Q2BJl08373; Tue, 25 Feb 2003 21:11:19 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Kenichi Handa Original-cc: d.love@dl.ac.uk Original-cc: sds@gnu.org Original-cc: emacs-devel@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:11955 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11955 > (if (multibyte-string-p variable) > (setq variable (encode-coding-string variable locale-coding-system))) > > multibyte-string-p is mandatory because encode-coding-string > will change the byte-sequence of `variable' even if it is > unibyte. > Ex. (encode-coding-string "\201\300" 'iso-latin-1) => "\300" I find this behavior annoying because it makes the emacs-mule encoding appear in a situation where it is not mentioned. I wish that (encode-coding-string "\201\300" 'iso-latin-1) and (encode-coding-string (string-to-multibyte "\201\300") 'iso-latin-1) returned the same value. Stefan