Christophe Jacquet

Character encoding in TeXShop

It can be a real pain to open files with various character encodings inside TeXShop. Indeed, you basically have to change TeXShop’s settings each time.

Hopefully, I recently came across a little-documented feature that allows you to specify the encoding on a per-file basis: you simply add a metadata (a special TeX comment) at the top of the file to set the encoding, and TeXShop will load and save it accordingly. Use:

%!TEX encoding = IsoLatin

for ISO-8859-1 (Latin 1), or:

%!TEX encoding = UTF-8 Unicode

for UTF-8. Be sure to type exactly that, as TeXShop is case-sensitively picky!

Well, that’s not bad, but it could be far better:

Update, 2011-05-20: I have written a new note about all TeXShop’s magic comments.

Valid HTML5? © . ✍ Contact. Imprint (Mentions légales).