I am trying to modify a buffer written by desktop-save
to a file. The file is named .emacs.desktop
and I am trying to modify it from a Perl script. It turns out that it is saved in emacs-mule
encoding.
From M-x list-coding-systems
:
U -- utf-8 (alias: mule-utf-8)
UTF-8 (no signature (BOM))
M -- emacs-mule
Emacs 21 internal format used in buffer and string.
I would like to read the file in Perl as UTF-8
, how can this be done?
(I would prefer a solution that does not depend on a running Emacs server)
(An example: emacs-mule
saves the letter æ
as two bytes 0x81 0xe6
, ISO Latin 1 saves it as a single byte 0xe6
, whereas UTF-8 saves it as two bytes 0xc3 0xa6
.. )
M-x revert-buffer-with-coding-system
help?emacs-mule
coding out of the file src/coding.c in the emacs source code. There are extensive comments in that file.