23
15
Suddenly some of my text files, I'm editing with Emacs
had changed and special characters were shown in a strange way, e. g.
\344
instead of ä
\374
instead of ü
... and so on.
In another file I now have
ü
for ü
ä
for ä
....
(I don't know which event was the cause for that, maybe I've been doing something wrong.)
I'd like to convert the document back to its original state (my standard encoding is UTF-8), so that it is displayed correctly with ä, ö, ü, ... but I do not know how to do that with emacs.
Unfortunately, I need that command quite often, so I'd like to define a keyboard shortcut to invoke recode-region (orig: latin-1, interpreted as utf-8-dos) with one keystroke. How can I define a little program, which does that and which I can map to a key? – MostlyHarmless – 2014-01-21T14:19:30.963
1
You could record it as a macro, and then name, bind and save it as described here: http://www.gnu.org/software/emacs/manual/html_node/emacs/Save-Keyboard-Macro.html
– legoscia – 2014-01-21T14:59:32.163