emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 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/)]
@ 2018-09-22  6:10 Sigmund Tzeng
  2018-09-27 14:58 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Sigmund Tzeng @ 2018-09-22  6:10 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]

Hi all,

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)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It took me some time. Hope to see it in next version if you think it's OK.

Best Regards,

Sig Tzeng

Emacs  : GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Package: Org mode version 9.1.14 (9.1.14-1-g4931fc-elpa @
c:/Users/sig/emacs261/.emacs.d/elpa/org-9.1.14/)

[-- Attachment #2: Type: text/html, Size: 1949 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* 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/)]
  2018-09-22  6:10 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/)] Sigmund Tzeng
@ 2018-09-27 14:58 ` Nicolas Goaziou
  2018-09-29  2:28   ` Sigmund Tzeng
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2018-09-27 14:58 UTC (permalink / raw)
  To: Sigmund Tzeng; +Cc: emacs-orgmode

Hello,

Sigmund Tzeng <sig.tzeng@gmail.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 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/)]
  2018-09-27 14:58 ` Nicolas Goaziou
@ 2018-09-29  2:28   ` Sigmund Tzeng
  2018-09-29  6:50     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Sigmund Tzeng @ 2018-09-29  2:28 UTC (permalink / raw)
  To: emacs-orgmode, Nicolas Goaziou

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]

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 <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Sigmund Tzeng <sig.tzeng@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 3496 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* 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/)]
  2018-09-29  2:28   ` Sigmund Tzeng
@ 2018-09-29  6:50     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2018-09-29  6:50 UTC (permalink / raw)
  To: Sigmund Tzeng; +Cc: emacs-orgmode

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

> I get your point. The git diff order is wrong. Here it is:

Applied. I added a proper commit message.

Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-29  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-22  6:10 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/)] Sigmund Tzeng
2018-09-27 14:58 ` Nicolas Goaziou
2018-09-29  2:28   ` Sigmund Tzeng
2018-09-29  6:50     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).