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: Using utf-8-auto as a process coding system Date: Fri, 25 Jul 2014 16:03:45 +0300 Message-ID: <83zjfxio9a.fsf@gnu.org> References: <83fvhu4tbg.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1406293443 12794 80.91.229.3 (25 Jul 2014 13:04:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Jul 2014 13:04:03 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 25 15:03:57 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XAfAC-0006d3-Sb for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 15:03:56 +0200 Original-Received: from localhost ([::1]:54646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAfAC-0002QK-DA for ged-emacs-devel@m.gmane.org; Fri, 25 Jul 2014 09:03:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAf9z-00029y-7s for emacs-devel@gnu.org; Fri, 25 Jul 2014 09:03:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAf9u-0001W8-Bt for emacs-devel@gnu.org; Fri, 25 Jul 2014 09:03:43 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:48715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAf9u-0001VW-3X for emacs-devel@gnu.org; Fri, 25 Jul 2014 09:03:38 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N9900800QJTUY00@mtaout24.012.net.il> for emacs-devel@gnu.org; Fri, 25 Jul 2014 15:59:33 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N99002S6QR9AU60@mtaout24.012.net.il>; Fri, 25 Jul 2014 15:59:33 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173138 Archived-At: > Date: Tue, 22 Jul 2014 08:55:53 +0300 > From: Bozhidar Batsov > Cc: schwab@suse.de, emacs-devel@gnu.org >=20 > Ops, I actually used an incorrect link. That=E2=80=99s the proper o= ne -=C2=A0https://github.com/clojure-emacs/cider/issues/532 OK, but that one is very short ;-) > The gist of my problem is that Windows users have encoding related = problems running cider (discussion here=C2=A0https://github.com/cloju= re-emacs/cider/issues/474). There's a lot of confusion in that discussion. > I guess the problem stems from this bit of code:=C2=A0 >=20 > (set-process-coding-system process 'utf-8-unix 'utf-8-unix) '-auto' is not about end-of-line (EOL) format, it is about the Byte Order Mark BOM (http://en.wikipedia.org/wiki/Byte_order_mark). Does Cider on Windows indeed output UTF-8 encoded text preceded by a BOM? I'd be surprised, as the BOM is normally not needed with UTF-8. In which case all this -auto thing just comes from another confused user. If there's no BOM, the first thing I'd try on Windows is this: (set-process-coding-system process 'utf-8-dos 'utf-8-unix) This is because Windows programs will normally accept Unix EOL format on input, but will usually output Windows CR-LF EOL, which Emacs need= s to decode into a single newline character. A more elegant solution, which should be platform-independent, is to use something like below (untested) (set-process-coding-system process =09=09=09 (cons (coding-system-change-text-conversion =09=09=09 (car default-process-coding-system) =09=09=09 'utf-8) =09=09=09=09 (coding-system-change-text-conversion =09=09=09=09 (cdr default-process-coding-system) 'utf-8))) This has the advantage that it uses the wisdom already invested in setting the defaults for each platform.