From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sigmund Tzeng Subject: Re: Bug: utf-8 support for ob-dot.el [9.1.14 (9.1.14-1-g4931fc-elpa @ c:/Users/sig/emacs261/.emacs.d/elpa/org-9.1.14/)] Date: Sat, 29 Sep 2018 10:28:09 +0800 Message-ID: References: <87d0szhtqx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000773ac20576f95385" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g64zZ-00032P-Rj for emacs-orgmode@gnu.org; Fri, 28 Sep 2018 22:28:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g64zY-0002Gc-DV for emacs-orgmode@gnu.org; Fri, 28 Sep 2018 22:28:25 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:42473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g64zY-0002GT-4t for emacs-orgmode@gnu.org; Fri, 28 Sep 2018 22:28:24 -0400 Received: by mail-ot1-x332.google.com with SMTP id h26-v6so7862271otl.9 for ; Fri, 28 Sep 2018 19:28:23 -0700 (PDT) In-Reply-To: <87d0szhtqx.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org, Nicolas Goaziou --000000000000773ac20576f95385 Content-Type: text/plain; charset="UTF-8" Hi Nicolas, I get your point. The git diff order is wrong. Here it is: --- lisp/ob-dot.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/ob-dot.el b/lisp/ob-dot.el index 31e0a4f32..7220a9e76 100644 --- a/lisp/ob-dot.el +++ b/lisp/ob-dot.el @@ -69,6 +69,8 @@ This function is called by `org-babel-execute-src-block'." (cmdline (or (cdr (assq :cmdline params)) (format "-T%s" (file-name-extension out-file)))) (cmd (or (cdr (assq :cmd params)) "dot")) + (coding-system-for-read 'utf-8) ;; use utf-8 with subprocesses + (coding-system-for-write 'utf-8) (in-file (org-babel-temp-file "dot-"))) (with-temp-file in-file (insert (org-babel-expand-body:dot body params))) -- TINYCHANGE Have a nice weekend. Sigmund Tzeng On Thu, Sep 27, 2018 at 10:58 PM Nicolas Goaziou wrote: > Hello, > > Sigmund Tzeng writes: > > > When trying to render a dot file with utf-8 encoded characters, > > org babel complained about the encodings. I cross checked ob-go.el at > > line 107-108 and made an identical patch to make utf-8 dot files work: > > > > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > > diff --git "a/elpa\\org-9.1.14\\ob-dot.el" > > "b/\\emacs261\\share\\emacs\\26.1\\lisp\\org\\ob-dot.el" > > index 0fe50d4..31e0a4f 100644 > > --- "a/elpa\\org-9.1.14\\ob-dot.el" > > +++ "b/\\emacs261\\share\\emacs\\26.1\\lisp\\org\\ob-dot.el" > > @@ -69,8 +69,6 @@ This function is called by > `org-babel-execute-src-block'." > > (cmdline (or (cdr (assq :cmdline params)) > > (format "-T%s" (file-name-extension out-file)))) > > (cmd (or (cdr (assq :cmd params)) "dot")) > > - (coding-system-for-read 'utf-8) ;; use utf-8 with subprocesses > > - (coding-system-for-write 'utf-8) > > (in-file (org-babel-temp-file "dot-"))) > > (with-temp-file in-file > > (insert (org-babel-expand-body:dot body params))) > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > I'm a bit surprised Emacs doesn't do the right thing here. > > Anyway, could you provide a commit message and use "git format-patch" > command. Also, could you add TINYCHANGE cookie if you haven't signed FSF > papers yet. > > Thank you. > > Regards, > > -- > Nicolas Goaziou > --000000000000773ac20576f95385 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

I get your point. The git diff order is wrong. Here it is= :
---
=C2=A0lisp/ob-dot.el | 2 ++
=C2=A01= file changed, 2 insertions(+)

diff --git a/lisp/o= b-dot.el b/lisp/ob-dot.el
index 31e0a4f32..7220a9e76 100644
=
--- a/lisp/ob-dot.el
+++ b/lisp/ob-dot.el
@@ -69,6= +69,8 @@ This function is called by `org-babel-execute-src-block'.&quo= t;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cmdline (or (cdr (assq :cmd= line params))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "-T%s" (file-name-extension o= ut-file))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cmd (or (cdr (assq= :cmd params)) "dot"))
+=C2=A0 =C2=A0 =C2=A0(coding-sys= tem-for-read 'utf-8) ;; use utf-8 with subprocesses
+=C2=A0 = =C2=A0 =C2=A0(coding-system-for-write 'utf-8)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(in-file (org-babel-temp-file "dot-")))
=
=C2=A0 =C2=A0 =C2=A0(with-temp-file in-file
=C2=A0 =C2=A0 = =C2=A0 =C2=A0(insert (org-babel-expand-body:dot body params)))
--=
TINYCHANGE

Have a nice weekend.

Sigmund Tzeng

On Thu, Sep 27, 2018 at 10:58 PM Nicolas Goazio= u <mail@nico= lasgoaziou.fr> wrote:
Hello,=

Sigmund Tzeng <= sig.tzeng@gmail.com> writes:

> When trying to render a dot file with utf-8 encoded=C2=A0 characters,<= br> > org babel complained about the encodings. I cross checked ob-go.el at<= br> > line 107-108 and made an identical patch to make utf-8 dot files work:=
>
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv= vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> diff --git "a/elpa\\org-9.1.14\\ob-dot.el"
> "b/\\emacs261\\share\\emacs\\26.1\\lisp\\org\\ob-dot.el"
> index 0fe50d4..31e0a4f 100644
> --- "a/elpa\\org-9.1.14\\ob-dot.el"
> +++ "b/\\emacs261\\share\\emacs\\26.1\\lisp\\org\\ob-dot.el"=
> @@ -69,8 +69,6 @@ This function is called by `org-babel-execute-src-bl= ock'."
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cmdline (or (cdr (assq :cmdline par= ams))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(format "-T%s" (file-name-extension out-file))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cmd (or (cdr (assq :cmd params)) &q= uot;dot"))
> -=C2=A0 =C2=A0 =C2=A0(coding-system-for-read 'utf-8) ;; use utf-8 = with subprocesses
> -=C2=A0 =C2=A0 =C2=A0(coding-system-for-write 'utf-8)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (in-file (org-babel-temp-file "= dot-")))
>=C2=A0 =C2=A0 =C2=A0 (with-temp-file in-file
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert (org-babel-expand-body:dot body par= ams)))
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm a bit surprised Emacs doesn't do the right thing here.

Anyway, could you provide a commit message and use "git format-patch&q= uot;
command. Also, could you add TINYCHANGE cookie if you haven't signed FS= F
papers yet.

Thank you.

Regards,

--
Nicolas Goaziou
--000000000000773ac20576f95385--