Question

I'll try to put this as clearly as possible, since I myself don't understand very well what's going on.

If I have a buffer opened in Emacs, and it's in, let's say UTF-8 (could be anything really), and I paste some text that is in another encoding (from a PDF for example), Emacs will CHANGE the original encoding (UTF8) to the new encoding...

This is a pain in the ass, because it screws up thousands of other text lines, just so the new line can be correctly displayed...

So I guess my question is, how can I tell Emacs to NEVER change the encoding of the file? If a character can't be represented in the present encoding, than just don't show it (or show it all messed up like usually happens).

Thanks

No correct solution

OTHER TIPS

Specifying -*- coding: utf-8 -*- (or whatever encoding you want) at the top of the file will force that encoding for that particular file. The relevant manual page is here.

For a more systematic approach, you might want to investigate the docstring for the file-coding-system-alist variable, which forces encodings based on filenames.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top