From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SsO8cmdlbiBIw7Z0emVs?= Newsgroups: gmane.emacs.devel Subject: BOM (byte order mark) in process stdout and stderr Date: Thu, 25 Jun 2015 18:41:50 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ffb48068c2805195a4eae X-Trace: ger.gmane.org 1435250573 19099 80.91.229.3 (25 Jun 2015 16:42:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 16:42:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 25 18:42:42 2015 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 1Z8AEb-0008Kt-UO for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 18:42:42 +0200 Original-Received: from localhost ([::1]:56627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8AEa-0000y9-Tj for ged-emacs-devel@m.gmane.org; Thu, 25 Jun 2015 12:42:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8AED-0000wB-VQ for emacs-devel@gnu.org; Thu, 25 Jun 2015 12:42:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8AE8-0001Pw-0N for emacs-devel@gnu.org; Thu, 25 Jun 2015 12:42:17 -0400 Original-Received: from mail-ig0-f178.google.com ([209.85.213.178]:35381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8AE7-0001PO-Rm for emacs-devel@gnu.org; Thu, 25 Jun 2015 12:42:11 -0400 Original-Received: by igblr2 with SMTP id lr2so101065236igb.0 for ; Thu, 25 Jun 2015 09:42:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=eDsJGYtnBmeUXU13RVQfMygIikq2qavPfMmvt0u5zPI=; b=D/2v+VeGmSMvwjTsybMzbpymWhqskUYGrBwnptDMabi9qx4WRi/Zm1n9gBfedIDOVN 6PGBI/110vQadBbGLngEOW+VQ8EFVcUagFgwwI1QwvzF24EbNNsFfJfkoUA4dYJ56BGU F+W7fuvK8Js8Ap9PNk4UDv/TJVAGBDbA3f5SWznOdZhkdFZ7BlGvECpJ/itSR5HTcyGe JsRMGV4Ifbi3kkBLau3tSs9DfOpM9dFWn5NyGk02gdtYdzmVDJWykkpvulbc5J/+KA6o 8I4giVzb6YjxiFAVWfNszL8vvLf9OHpS0FKawLVu/OziGZlfkGE0oUhuYh4DhF/WWuTP Rhtw== X-Gm-Message-State: ALoCoQmur1NlKr6cwSe2wMI/o3+4EGWM2/3OjzGVlbWX3S5HtloBmL4ipBS4aqPt5H0Jz/CSX8pE X-Received: by 10.107.134.214 with SMTP id q83mr43826365ioi.91.1435250530338; Thu, 25 Jun 2015 09:42:10 -0700 (PDT) Original-Received: by 10.64.63.51 with HTTP; Thu, 25 Jun 2015 09:41:50 -0700 (PDT) X-Originating-IP: [84.59.244.152] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.213.178 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:187525 Archived-At: --001a113ffb48068c2805195a4eae Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I compiled this C#/Mono program on an UTF-8 GNU/Linux System using System; public class Hello { static void Main() { Console.WriteLine("STDOUT"); Console.Error.WriteLine("STDERR"); } } and used this elisp code to get the process output: (let ((default-process-coding-system '(utf-8-with-signature . utf-8-with-signature))) (start-file-process "BOM" (generate-new-buffer "*bom-test*") "~/tmp/Hello.exe")) This results in the following process-buffer (hexl-mode): 00000000: efbb bf53 5444 4f55 540a 5354 4445 5252 ...STDOUT.STDERR 00000010: 0a0a 5072 6f63 6573 7320 424f 4d20 6669 ..Process BOM fi 00000020: 6e69 7368 6564 0a nished. The stdout BOM was correctly removed but the stderr BOM is still present. According to http://www.gnu.org/software/emacs/manual/html_node/elisp/Output-from-Proces= ses.html there is now way to handle stderr separately. I made this workaround for the Emacs fsharp-mode: https://github.com/juergenhoetzel/fsharpbinding/commit/d0d3600c38d0e9f47a62= 1583d0fc82685feda196 Are there any better solutions? J=C3=BCrgen --001a113ffb48068c2805195a4eae Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I compiled =C2=A0this C#/Mono program on an UTF-8 GNU/Lin= ux System


using System;

public class Hel= lo
{
=C2=A0 =C2=A0 static void Main()
=C2=A0 =C2=A0 {
Conso= le.WriteLine("STDOUT");
Console.Error.WriteLin= e("STDERR");
=C2= =A0 =C2=A0 }
}

and used this elisp code to get the process output:
<= div style=3D"font-size:12.8000001907349px">

(let ((default-process-coding-system '(utf-8-with-signature . utf-8-wi= th-signature)))
=C2=A0 (st= art-file-process
=C2=A0 = =C2=A0"BOM"
=C2= =A0 =C2=A0(generate-new-buffer "*bom-test*")
=C2=A0 =C2=A0"~/tmp/Hello.exe"))

This results in the following process-buffer (hexl= -mode):

00000000: efbb bf53 5444 4f55 540a 5354= 4445 5252 =C2=A0...STDOUT.STDERR
00000010: 0a0a 5072 6f63 6573 7320 424f 4d20 6669 =C2=A0..Process B= OM fi
00000020: 6e69 7368 = 6564 0a =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0nished.
<= br>
The stdout BOM was cor= rectly removed but the stderr BOM is still present.

According to=C2=A0http://www.gn= u.org/software/emacs/manual/html_node/elisp/Output-from-Processes.html<= /div>

there is now way to handle stderr=C2=A0separate= ly. I made this workaround for the Emacs fsharp-mode:


Are there any better solutions?

J=C3=BCrgen
--001a113ffb48068c2805195a4eae--