I'm really confused about this issue since it should be doable, but i fail to understand it.
I have some file with broken encoding (a pdf file, actually), which I copy some text from. When I paste this text into emacs (or anywhere else) I get sth like "íàïðèìåð", while the correct variant should be cyrillic "например". My buffer encoding is
utf-8 and the broken text has something to do with
cp1251. My goal is - obviously - to repair this broken encoding and insert it in place of the broken pasted text.
I tried different combinations of
cp1251, but it gave me some other broken encodings or just a bunch of spaces (that's kinda weird)
Sorry for my messy statement, I just really don't get all this encoding stuff.
What I achieved is a (half)solution for the reverse problem: if i write
(encode-coding-string "например" 'cp1251) and press
C-x C-e, it prints "íàïðèìåð" to the messages. It's strange, but if I try to insert result of this computation into a buffer I get some nonsense yet again... Maybe I miss another aspect of this problem...