# Non-ASCII characters in TexPad desktop in XeLaTex

I am using Texpad 1.7.42 (Desktop, not cloud or iOS), to edit locally TeX documents produced originally in the cloud (on Overleaf). My documents contain many Unicode characters, and use XeLaTex with fontspec loaded.

This is the document I produced in Overleaf:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\begin{document}
Résumé
\end{document}


When I download the .tex file, and open it in Texpad, Texpad transforms

Résumé


into

 RÃ©sumÃ©


(The rest of the file is unchanged, and it compiles without issue)

Texpad's support documentation acknowledges an issue with unicode characters, and their recommendation is to insert:\usepackage[utf8]{inputenc}. However, as I am using fontspec, inputenc has no effect, and inserting it into my MWE changes nothing.

Similarly, this solution given for a similar problem in TexShop (inserting % !TEX encoding = UTF-8 Unicode) doesn't work.

Is there any way to use Unicode characters along with XeLaTeX and fontspec in Texpad?

• Your file is correct, only texpad doesn't show it correctly. It handles the file as it if where 8bit encoded. Check if you can reopen it as utf8. – Ulrike Fischer Jun 15 '17 at 16:54
• @UlrikeFischer Unfortunately, I don't see any way to do that. I (and I'm sorry I didn't mention this in the question) saved the .tex file in UTF8 encoding in TextEdit before opening it in TexPad, but the issue persists, even when the file is explicitly utf8 – user77402 Jun 15 '17 at 16:58
• What do you mean by "explicitly"? Different editors do things differently. Are you sure there is no Preference setting in TeXPad for the default encoding setting for opening files? – Herb Schulz Jun 15 '17 at 17:11
• @HerbSchulz I simply meant that I had saved it with a UTF8 encoding. I am sure there is no setting, having gone through both the settings panel, and Texpad's support documentation (linked in my question). (If you would find it helpful, I could upload screenshots of the settings panel) – user77402 Jun 15 '17 at 17:15
• @HerbSchulz There is no option button :( – user77402 Jun 15 '17 at 18:14

## 2 Answers

I just looked at the online TeXPad manual and it says there is a File->File Encoding menu item. Change to UTF-8. If possible try doing that with no open files to make sure you don't get a conversion that will make you unhappy.

This is not the problem the original poster had, but for those brought to this page’s title by a search engine (as I was), here’s what eventually worked for me for text mode. N.b. not math mode, which is completely broken due to “missing a few extensions required to support the unicode-math package.”

Texpad’s proprietary LaTeX compiler doesn’t handle Unicode by default; e.g. “∀z z∉z ⇒ z∈x” hides everything but “z zz zx.” Unchecking Auto-Sense in the document’s Typeset/General configuration and changing to Unicode Mode instead gives garbage characters. (A common failing, but I expected better from a commercial Mac app. The documentation sort of hints at this, but without providing a solution.)

Some combination of the following got mathematical symbols to show up properly:

• Installing the Latin Modern Math and LMRoman fonts on my Mac.
• Enabling the following optional bundles in TexpadTex Typesetter Preferences: Extra Fonts, Supplementary Font Files, Font Utility Packages (which crashed the app while downloading), Math and Science Packages.
• Adding the following kludge to my preamble:
\usepackage{fontspec}
\setmainfont[Mapping=tex-text, ItalicFont={Latin Modern Roman Slanted}, BoldFont={Latin Modern Roman Demi}]{Latin Modern Math}


Those setmainfont options are obviously not comprehensive; see Best way of using the full range of full fonts/styles/faces for Latin Modern Roman?

Another gotcha was that enabling microtype silently switches away from TexpadTex. And claims of support for the paid version turn out to be mostly illusory.