Back in the old days, before I left the hallowed shores of my native country, I didn't much care what encoding my files were in. ASCII was enough for my great-great grandfather so it was enough for me. Now I live in the land of my great-great-…-great grandfathers who have a slightly mangled alphabet and ASCII no longer suffices. That would be fine if it were just me: I've learned to love UTF-8 and have even embraced
xelatex. But sometimes I get sent documents in weird encodings, and sometimes I want to resurrect some old document, maybe to include a section in a new document, so from time to time I find myself wanting to change the encoding of a document.
So: how do I do that? (Included subquestion: how do I determine the encoding of a file?)
- I realise that this is only tangentially related to TeX and friends, so am fully prepared to be told to look elsewhere, but I think that this is quite common and especially (due to the fact that it seems one has to be super-aware of encodings with TeX) important for TeXers.
- I don't have a specific example file in mind here, this is a "generic" question hoping to build a useful resource. So please answer in as full generality as you can and where you need to place restrictions, please make them clear. In particular, this will almost certainly have different answers depending on the OS.
- On the other hand, if you do know a super-snazzy-wizzy method that works just brilliantly when using Emacs at midnight with a full moon, then please do post it – just be sure to include whether you are assuming the strong lycanthropic principle or only the weak one.
- In light of those last two, I'd be happy for this to be CW with one answer gathering together all the techniques in a sensible grouping.
- If this question doesn't get closed and does work as I intend, these notes should probably be removed so as not to distract from the usefulness of the answers (and because we probably don't want TeX-SX to be the number one hit for the "strong lycanthropic principle").