bug#81606: Mojibake with UTF-8 file names

Arash Esbati <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Eli Zaretskii <[email protected]> writes:

> Edebug has a command to produce a backtrace; please use that.

Ah, thanks for the hint:

--8<---------------cut here---------------start------------->8---
latexenc-find-file-coding-system((insert-file-contents "/path/to/ä-include.tex" t nil nil nil))
insert-file-contents("~/path/to/ä-include.tex" t)
find-file-noselect-1(#<buffer ä-include.tex> "~/path/to/ä-include.tex" nil nil "~/path/to/ä-include.tex" (125108739 16777233))
find-file-noselect("~/path/to/ä-include.tex" nil nil t)
find-file("~/path/to/ä-include.tex" t)
funcall-interactively(find-file "~/path/to/ä-include.tex" t)
command-execute(find-file)
--8<---------------cut here---------------end--------------->8---

> You are aware that \303\244 is the UTF-8 sequence for ä, are you?

Yes, I'm aware of that.

> The above seems to mean that the search is done on a unibyte buffer or
> something.

This is what I meant to say, thanks.  

I wrote this in my initial reply to this report:

  So I think `latexenc-find-file-coding-system' returns the wrong value
  since Emacs hasn't set its coding for read properly when that function
  kicks in.  I admit I'm not knowledgeable in this area, so my pretty
  simple recommendation is to customize the variable
  `file-coding-system-alist' and do something like this:

    (add-to-list 'file-coding-system-alist
                 '("\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'" . prefer-utf-8))

Apologies if the wording is not accurate, but I tried to say the same
thing as you above.

Best, Arash
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.