Hello, pierre.techouey...@free.fr (Pierre Téchoueyres) writes:
> I did my homework : found a fix for a) and rebased previous patch on > master. Thank you. Some comments follow. > * lisp/ox.el (org-export-expand-include-keyword): Add new keyword > `:coding' for specify the file encoding whith the `#+include:' > directive. > > This allow to use somting like : > #+include: "./myfile" :coding cp850-dos > when your org-file is encoded in utf-8 for example. Nitpick: Org file > ** New features > +*** New keyword for ~#+include:~ directive > +Add ~:coding "codign-system"~ keyword to allow include of files from =~:coding coding-system= > +different codign system than the main org-file. Org file. > +For example: > +#+begin_example > +,#+INCLUDE: "myfile.cmd" src cmd :coding cp850-dos > +#+end_example Note that we are freezing Org 9.2 right now. This will go into master once 9.2 is out. > + (coding > + (intern (or (and (string-match > + ":coding +\\<\\([a-z0-9\\-]+\\)\\>" value) > + (prog1 (match-string 1 value) > + (setq value (replace-match "" nil nil > value)))) > + (symbol-name coding-system-for-read)))) (coding (or (and (string-match ":coding +\\([a-z0-9\\-]+\\)" value) (prog1 (intern (match-string 1 value)) (setq value (replace-match "" nil nil value)))) coding-system-for-read)) In Lisp, symbol constituents are all words plus $&*+-_<> We might want to update the regexp accordingly. > +Subject: [PATCH] Correctly convert encoding of included files > + > +* lisp/ox.el (org-export--prepare-file-contents): convert temporary > + buffer encoding to org buffer's encoding. Org buffer's encoding. Could you send an updated patch? Regards, -- Nicolas Goaziou 0x80A93738