From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Codepages and shell function on w32 Date: Mon, 01 Jan 2007 00:49:42 -0500 Message-ID: References: <4597B981.9020506@gmail.com> <45987A73.6040702@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1167630620 16904 80.91.229.12 (1 Jan 2007 05:50:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Jan 2007 05:50:20 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 01 06:50:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H1G3s-00035C-Vo for ged-emacs-devel@m.gmane.org; Mon, 01 Jan 2007 06:50:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1G3s-0005RG-CN for ged-emacs-devel@m.gmane.org; Mon, 01 Jan 2007 00:50:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H1G3c-0005Pi-FT for emacs-devel@gnu.org; Mon, 01 Jan 2007 00:50:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H1G3b-0005Os-N9 for emacs-devel@gnu.org; Mon, 01 Jan 2007 00:49:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H1G3b-0005Oi-K8 for emacs-devel@gnu.org; Mon, 01 Jan 2007 00:49:59 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H1G3b-0006Mu-7s for emacs-devel@gnu.org; Mon, 01 Jan 2007 00:49:59 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1H1G3K-0008Mc-05; Mon, 01 Jan 2007 00:49:42 -0500 Original-To: "Lennart Borgman (gmail)" In-reply-to: <45987A73.6040702@gmail.com> (lennart.borgman@gmail.com) 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:64593 Archived-At: > Date: Mon, 01 Jan 2007 04:05:23 +0100 > From: "Lennart Borgman (gmail)" > CC: emacs-devel@gnu.org > > Eli Zaretskii wrote: > >> Date: Sun, 31 Dec 2006 14:22:09 +0100 > >> From: "Lennart Borgman (gmail)" > >> > >> (cp-out (read (format "cp%s" (w32-get-console-output-codepage)))) > >> (cp-in (read (format "cp%s" (w32-get-console-codepage))))) > >> (cond > >> ((w32-shell-dos-semantics) > >> (set-process-coding-system proc cp-out cp-in)) > >> > > > > This is wrong: w32-fns.el sets this as follows: > > > > (setq default-process-coding-system > > (if default-enable-multibyte-characters > > '(undecided-dos . undecided-unix) > > '(raw-text-dos . raw-text-unix))) > > > > The output encoding uses *-unix for a good reason. > > Can you please explain a bit more? How should it look? I meant the EOL conversion that you've left unspecified (i.e. open to Emacs guesswork on input and subtle black magic on output). You need to use coding-system-change-eol-conversion to force the car of the cons cell use -dos, and the cdr to use -unix. (I hope this answers your question because, frankly, I'm not quite sure what you were asking.) > In the case > cmdproxy case (the case above) it works for me with this code using > Swedish characters in file names for example. ``Works for me'' is not a replacement for good engineering, because your testing can never find all problems. We use these specific EOL conversions for input and output because of the reason explained in this comment in w32-fns.el: ;; Most programs on Windows will accept Unix line endings on input ;; (and some programs ported from Unix require it) but most will ;; produce DOS line endings on output. > > Does Cygwin at all support anything beyond the C locale? If not, > > that's the reason why windows-1252 doesn't work for you. > > I have no idea. It's very easy to verify, if you have Cygwin programs installed, no? > What do I write to test with the C locale? I'd suggest the other way around: try to get a Cygwin program to work correctly in a non-C locale. For example, `sort' should use the correct sorting order with non-ASCII (Swedish) characters, `ls' should display file names with correct Swedish characters, etc.