[OS X TeX] TeXShop 3 and text encoding on Lion - serious problems

Luis Sequeira lfsequeira at gmail.com
Sun Sep 18 18:34:23 CEST 2011


> Howdy,
> 
> What encoding was used to save the initial file? TeXShop initially defaults to MacOSRoman (applemac to inputenc) but that default can be changed in TeXShop->Preferences->Source->Encoding and then non-ascii characters will appear abnormal if the file was saved with a different encoding. Put the line
> 
> % !TEX encoding = MacOSRoman
> 
> near the top of your source file if the file is actually saved in that encoding and TeXShop will always open that file with that encoding independent of the default encoding. use `UTF-8 Unicode' instead of `MacOSRoman' (without the quotes of course) if you want to use UTF-8 and use `IsoLatin' instead of `MacOSRoman' if you are using Latin1.
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)
> 

The original file was in MacRoman encoding, and I was selecting that encoding from within the "Open..." dialog box.
The original file had no "% !TEX encoding" line. 

My wife has always worked with MacRoman, but in my mac I've had Latin1 as default, since that was what collaborators that use windows had (and they had no clue what an encoding is, so it was far easier for me to convert files and stick to something that worked for everyone, rather than tell them to convert to utf-8). 

That is why I could spot this problem; if people always use the same encoding, they probably have set it as default and would never face this situation.

> Howdy,
> 
> The \usepackage[applemac]{inputenc} line tells LaTeX how to interpret the byte stream of the file but it doesn't tell TeXshop how to interpret that same byte stream when it read the file in and displays it in the editor. What is the default encoding you have set up for TeXshop? You can see it in TeXShop->Preferences->Source->Encoding. That is how TeXShop will interpret the byte stream. To guarantee that TeXShop gets the correct encoding place the line
> 
> % !TEX encoding = MacOSRoman
> 
> (for applemac encoding) near the top of the file.
> 
> One more things to note: I believe changing that line to reflect a different encoding (e.g., IsoLatin for latin1 or UTF-8 Unicode for utf8) will NOT change the encoding for the file. Copy/Paste the document to a new file and put in the correct encoding line before saving.
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)
> 

I am fully aware of all that you mention above. I have used files encoded in MacRoman, Latin1 and UTF-8 over the years and I am familiar with the mechanisms for selecting an encoding: the "!TEX encoding" line and the popup menu at the bottom of the open dialog, as well as setting a default in the preferences.

I have investigated it further and exchanged messages with Richard Koch and we now believe that - probably because of some changes by Apple in the underlying frameworks - TeXShop under Lion is NOT honoring the selection of encoding in the "open" dialog box; it DOES honor the encoding indicated by the "!TEX encoding" line.

Richard Koch will be looking into it when he has the time, and I hope this will soon be fixed.

Thanks to all

Luis Sequeira






More information about the macostex-archives mailing list