TeXShop setting of UTF-8 is broken

3.6k Views Asked by At

for a long time, I tried to set up XeLaTeX to work with UTF-8 correct. Silly me!

A couple of days ago I have figured out, that XeLaTeX is working correct. When I edit or create a file using vi for example, everything works like a charme.

But when I am editing or creating a LaTeX file using TeXShop it tranforms german umlauts from

...
\begin{document}
\maketitle

üöäßÜÖÄ
...

into

\UTF{00FC}\UTF{00F6}\UTF{00E4}\UTF{00DF}\UTF{00D6}\UTF{00C4}\UTF{00DC}

As a result of the xelatex .tex I receive a

...
<name>.tex:<line number>: Undefined control sequence.
l<line number>\UTF
    {00FC}\UTF{00F6}\UTF{00E4}\UTF{00DF}\UTF{00D6}\UTF{00C4}\UTF{00DC}%    

Where is a filename and is the position. It is not relevant!

I have set up to save the file as Unicode(UTF-8) in the TeXShop Preferences (TeXShop ->Preferences...->Source) but it does not help.

On my other computer I have the same version installed. On this one it is saving the document correct.

Even reinstalling did not help.

The file is saved using the strange \UTF{...} notation instead of the character.

How can I fix the encoding when saving?

Thank you in advance

Alexander

2

There are 2 best solutions below

0
On

Because I've the same problem and searched a lot:

In the menu go to:

TeXShop -> Preferences... -> Misc -> pTeX support -> utf export.

Uncheck this checkbox!

0
On

After spending 2 hours making experiments, I found your answer. Thanks a lot. I could fix my own environment. However, in addition to
TeXShop -> Preferences... -> Misc -> pTeX support -> utf export
I also had to uncheck
TeXShop -> Preferences... -> Misc -> Automatic conversion from UTF-8-Mac into UTF-8
(not sure about the exact English message, I work under another language). I thought it could be useful for other people.