# [OS X TeX] TexShop and UTF-8

Michael Sharpe msharpe at ucsd.edu
Sat Mar 21 07:24:18 CET 2015

> On Mar 20, 2015, at 5:26 PM, Jutta Wrage <jw at witch.westfalen.de> wrote:
>
> Hi!
>
> Looks like Texshop messses up utf-8 tex files.
>
> I do the following:
>
> Export a tex file from Lyx. Lyx is set up to use utf-8 as there has been no other way to get my German umlauts and other things from Bibdesk bib files to documents.
>
> I set up TexShop to use utf-8 encoding for files
>
> Then I open the tex file and it gets automatically processed and the pdf opens.
>
> That is okay so far...
>
> But then I want to test something, edit the file and now I see an error in the console. Processing stops:
> ....
> ./koma-brief-Test.tex:57: Undefined control sequence.
> \scr at toname@var ...tr. 3\linebreak {} 48141 M\UTF
>                                                  {00FC}nster
> l.57 \opening{Sehr geehrter Herr Mustermann}
>
> ?
> ....
>
> Next test: I open the file with BBEdit after exporting from Lyx
>
> % !TEX encoding = UTF-8 Unicode
>
> Same happens as before: First run okay, but when doing any changes to the file with built-in editor in TexShop the tex file is broken.
>
> If I set up Texshop to use latin-9 (latin-15 not available) and change the file in BBEdit to be latin-9 I can have umlauts in the file.
>
> At least I have no clue why the built in TexShop editor changes
> "Münster" to "M\UTF{00FC}nster" and saves this to the file when set up to use utf-8.
> Maybe, TexShop editor just ignores the utf-8 encoding?
>
> Even if I create a new tex file completely in TexShop same thing happens.
> Umlauts only work with latin1 or latin9.
>
> Workaround for now: Edit with BBEdit and save and then open for preview in TexShop to test it. This avoids using the Texshop editor.
>
> Jutta
>
> --
> http://www.witch.westfalen.de
>

You're not giving us much to go on by way of an example, so let me send you a test file I use to for check for misbehavior. I'm using TeXShop 3.50 and have  have Encoding set to Unicode (UTF-8) in TeXShop's preferences.

There's an umlauted u in the text. After compiling the original to check that it works as expected, copy uumlaut and paste it back in, recompile and check. Delete uumlaut and re-enter it using the character viewer, then recompile. Delete it and enter it as <backslash>"u. Compile again. Do these all work? (They all work for me.) Does it work when you enter uumlaut from your German keyboard? I can't test this.

Michael