bug#81606: Mojibake with UTF-8 file names

Werner LEMBERG <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
>> If a master file `foo` is specified in the local variables block,
>> AUCTeX checks whether it is exists, otherwise it gets created.
>> This string `foo` must be given in the encoding specified by the
>> `coding` cookie.
> 
> But this is trivially correct: any non-ASCII text in a file which has
> a 'coding:' cookie _must_ be encoded in the encoding specified by
> 'coding:".  Right?

There might be situations where the file encoding and the file name
encoding differ, for example on Windows.  I don't know enough about
the encoding handling in Emacs whether it automatically maps UTF-8
encoded file name strings (as implied by the `coding` cookie) to
UTF-16...

> The cookie guarantees that the entire file, including the Local
> Variables section, uses that single encoding.

Yes, thus my suggestion of being more strict in the documentation and
stating exactly this.

> If you want to require the 'coding:' cookie in all cases, that's
> fine, but then latexenc.el is not needed at all, see above.

Well, the AUCTeX documentation doesn't require it yet — otherwise I
wouldn't have noticed the problem.  I think it's a good thing if Emacs
has a heuristic fallback mechanism to handle the case without a
`coding` cookie.


    Werner
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.