I have some UTF-8-encoded text files which display strange escape codes in Emacs. For instance, this text:
In ista quaestione primo exponam quid intelligendum est per hoc nomen ‘Deus’; secundo, respondebo ad quaestionem.
Shows like this in Emacs:
This only happens in Emacs. Other editors show the text correctly. How can I fix this problem?
Update 1
If I call revert-buffer-with-coding-system
and select utf-8
the file get read correctly. So, as Gilles has correctly guessed, Emacs isn't detecting the file encoding. If I add the code ; -*- coding: utf-8 -*-
to the file, Emacs opens and displays it correctly.
Update 2
I reencoded the file in "UTF-8 with BOM encoding," and now it displays alright in Emacs. I don't know what's the difference between the two types, but Emacs seems to be aware of the BOMed one only.