# Error: Unicode char \u8:φ not set up for use with LaTeX

I have the following LaTeX document:

\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
φΔδ汉
\end{document}


But I get the following error:

\$ latex foo
This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
restricted \write18 enabled.
[...]
! Package inputenc Error: Unicode char \u8:φ not set up for use with LaTeX.


How can I use these and other UTF-8 characters?

Note: This and this look like duplicates but they are slightly different and don't answer my question.

-

The inputenc package, even with the utf8 option doesn't load all the Unicode tables. It loads only those for which it knows it will have to typeset some glyphs.

You have then to teach the proper environment, because each Unicode block requires a different TeX fonts (they have only 256 characters).

So your example works with pdflatex, but modified into the following code.

\documentclass{article}
\usepackage[LGRx,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{CJKutf8}
\begin{document}

\foreignlanguage{greek}{φΔδ}\begin{CJK}{UTF8}{gbsn}汉\end{CJK}

\end{document}


This is admittedly largely impractical for extensive usage of characters belonging to different blocks, so it may be advisable to switch to XeLaTeX or LuaLaTeX that can use OpenType fonts.

-

utf8 for pdflatex has only a limited subset of Unicode. Use xelatex with

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Code2000}
\begin{document}
φΔδ汉
\end{document}


Code2000 can be replaced by another OpenType or TrueType font which has all that characters.

-

This error occurs when the tex editor file encoding and the document file encoding are not the same.

E.g. editor file encoding is ISO-8859-1, and the document has \usepackage[utf8]{inputenc} command. Change the editor file encoding to UTF-8, and restart the editor.

(It is possible that your editor refers to file encoding as font encoding. For details, see the comments.)

-
Welcome to tex.sx! These aren't font encodings, but file encodings you're thinking of. – doncherry Nov 22 '12 at 18:28
Hello! Thank you, precisely so. (My editor refers to it as font encoding.) – NaMarPi Nov 22 '12 at 19:49
Then I would not trust that editor anymore ;). (Which one is it?) The thing is, there is a concept called font encodings in LaTeX, it's what you're dealing with when saying e.g. \usepackage[T1]{fontenc}. – doncherry Nov 22 '12 at 19:53
Texmaker. I am new here, and it is important to me to add correct answers. What is the etiquette here? Can I improve my answers after comments, or leave it as it is? – NaMarPi Nov 22 '12 at 20:07
It's definitely a good idea to edit your answer, possibly with a little note that the edit resulted from comments, but often that's not even necessary. Thanks for caring! (As for Texmaker: That's the editor I use as well. I'll file a bug report later.) – doncherry Nov 22 '12 at 20:23
show 1 more comment