auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] wrong encoding for *output* buffer


From: Ikumi Keita
Subject: Re: [AUCTeX] wrong encoding for *output* buffer
Date: Fri, 26 Jan 2018 22:33:59 +0900

Hi Werner,

>>>>> Werner LEMBERG <address@hidden> writes:
> [git commit 4b66b9f60e3ce4a552bd4f3230b659347add1446]

> Folks,

> I have the following in my master document.

>   %%% Local Variables:
>   %%% coding: utf-8
>   %%% mode: latex
>   %%% TeX-engine: xetex
>   %%% TeX-PDF-mode: t
>   %%% TeX-master: t
>   %%% End:

> However, the `*xxx output* buffer (showing the compilation results of
> xetex) is in latin-1 encoding – I guess this is due to

>   (set-language-environment "latin-1")
>   (setq-default buffer-file-coding-system 'latin-1)

> in my `~/.emacs' file...

> What must I do so that auctex obeys the local encoding variables in my
> master document, thus overriding `~/.emacs'?  [AFAICS, xetex *can* be
> forced to use non-UTF8 legacy encodings, so relying on `TeX-engine' is
> probably not sufficient.]

AUCTeX determines the coding system for reading from the output of
asynchronous TeX process by the function
`TeX-adjust-process-coding-system'.  It basically obeys the coding
system of the command buffer, i.e., the buffer in which `C-c C-c' or
something like it is issued.  So I expect that it usually works well.

Does the symptom you described occur for all xelatex documents or for
some particular documents?  If latter, one possible guess is that
(1) The document is devided in multiple files and
(2) The sub file of the master file has no multibyte characters, i.e.,
    contains only ASCII characters and
(3) The command buffer is the one for that ASCII sub file.
In that case, the local value of `buffer-file-coding-system' of the sub
file buffer can be a kind of `undecided-*', and emacs eventually uses
the value of `default-process-coding-system' for reading from the output
of xelatex.  With your settings, `default-process-coding-system' is
(iso-latin-1-* . iso-latin-1-*), so the utf-8 characters in the output
are not decoded correctly.

If this guess is right, putting the
%%% coding: utf-8
cookie in your ASCII sub file would do the trick.  This makes the local
value of `buffer-file-coding-system' to be the specified value, so the
utf-8 output from xelatex would be decoded correctly.

If this is not the case, I'm grateful if you provide sample xelatex
documents to examine.

Regards,
Ikumi Keita



reply via email to

[Prev in Thread] Current Thread [Next in Thread]