[TxMt] Re utf-8 encoding and LaTeX Watch + TeXShop

Gildas Hamel gweltaz at ucsc.edu
Tue Jun 26 00:54:39 UTC 2007


I have a question regarding utf-8 encoding and the interaction of 
TextMate and TeXShop.  I have been using utf-8 encoding now for a while. 
  Many of my files have been prepared in TeXShop, in utf8 encoding.  Now 
that I can open them in TextMate and use Latex Watch, with the variable 
TM_LATEX_VIEWER TeXShop on---a terrific combination---, I get the 
following TeXShop message which I'd like to avoid:

``This file was opened with MacOSRoman encoding.
The file could not be opened with Unicode (UTF-8) encoding because it
was not saved with that encoding. If you wish to open in another
encoding, close the window and open again.''

The pdf shows perfectly in TeXShop viewer, which I prefer for now.  How 
can I avoid the message I get from TeXShop?

Top of my file is:

\documentclass{article}
\usepackage{fancyhdr}
\usepackage[utf8x]{inputenc}
\usepackage{lmodern}
\usepackage[french,english]{babel}
\usepackage{textcomp}

--Gildas Hamel

Quote from Koch of TeXShop to Bastian Philipps at
http://ftp.tug.org/mail-archives/macostex-archives/2006-February/020357.html

 > Here is how TeXShop works: Internally it uses unicode. When it comes
 > time to write out the file, the internal representation is converted to
 > a string
 > using an encoding. (This is necessary even if the encoding is a Unicode
 > encoding, because the Unicode standard doesn't specify a particular way
 > of writing unicode to disk. So utf-8 is one possible unicode 
encoding, but
 > not the only one.)
 >
 > What happens if there is a unicode character in the text which is not
 > available
 > in the particular encoding chosen? Apple's routines contain a parameter
 > which
 > indicates whether this should create an error or if instead the
 > character should
 > just be ignored or converted to something else. I choose "ignore or
 > convert to
 > something else." So if you type, say, a Euro symbol, but the encoding
 > doesn't
 > support it, then TeXShop will still write out the file.
 >
 > There is somewhat similar code when you read text from disk. Apple's
 > routines
 > require that an encoding be specified, and then the file is converted
 > into Apple's
 > internal unicode form and displayed in the editor.
 >
 > But this time there is another problem. Suppose the encoding is utf-8
 > unicode,
 > and the file isn't legal urtf-8. Then when Apple's code reads the file,
 > it suddenly
 > says "wait, this doesn't make sense." In that case, it stops reading and
 > reports
 > an error to TeXShop. TeXShop then puts up the dialog you have reported
 > and reads the file again in MacOSRoman. (Every file is a legal MacOSRoman
 > file.)



More information about the textmate mailing list