[OS X TeX] text encoding corruption in TeXShop editor

Bruno Voisin bvoisin at mac.com
Wed Sep 13 08:36:45 EDT 2006

Le 13 sept. 06 à 14:12, Gianluca Gorni a écrit :

> For files that I have to open repeatedly over time I thought I had  
> found a way:
> in TeXShop I typed
> %!TEX encoding = IsoLatin
> at the top of the file. This way, I thought, next time I opened the  
> file
> by double-clicking, it would display correctly.
> I was wrong. It seems that TeXShop had not simply added the new top  
> line,
> but it had changed the code of all the non-ascii characters. Now  
> the file did not
> display correctly in any editor and any encoding that I tried.
> The compiled pdf also came out wrong.
> In BBEdit, adding
> %!TEX encoding = IsoLatin
> does not corrupt the file, and display will be fine in TeXShop.

There's the same problem with adding

%!TEX encoding = UTF-8 Unicode

in TeXShop: as soon as this line has been added, TeXShop takes it  
into account when saving the file. If the file content wasn't  
interpreted in the correct encoding upon opening, then that  
completely mixes it up.

So far I've resorted to several alternatives solutions:

- Use Cyclone <http://free.abracode.com/cyclone/> to convert the file  
to Mac OS Roman.

- Open TeXShop once to adjust the text encoding in the Prefs, quit  
it, and only then open the file in TEXShop to add the encoding- 
defining line.

- Use an alternative editor (TextEdit, BBEdit, TextWrangler, Alpha)  
to add the encoding-defining line first, before opening the file in  

Bruno Voisin

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list