No matter how I try to do it I always get the following error :

! Package inputenc Error: Unicode char \u8:­ not set up for use with LaTeX.

I have tried using ­­­$^{\circ}$, \deg, \textdegree, pasting the ° symbol directly, to no avail.

Here is the header of my document, in case one of those could be causing the errors :

  • I had the same issue. In my case it was an issue due to a misleading character in my bibdesk library. After exchange and a new run with BibTex everything was fine again. – user12684 Mar 16 '12 at 12:10
  • A quick solution is to use the "Zap Gremlins" feature in the fantastic (and free to use) TextWrangler. This removes non-ASCII, control and NULL characters. IF you want a simple ASCII input file this will save you lots of time looking for invisible characters. – boyfarrell Jul 1 '14 at 10:55
  • As noted by Antal Spector-Zabusky at the very end of his answer, compiling with xelatex should solve the issue. Just make sure to remove the \usepackage[utf8]{inputenc} line. – Skippy le Grand Gourou Jul 4 '17 at 10:23
  • 2
    You don’t need \usepackage[utf8]{inputenc} in any engine. It’s been the default since 2018. – Davislor Jun 9 '20 at 15:56
  • 1
    In XeLaTeX or LuaLaTeX, though, you would want to \usepackage{fontspec} instead of fontenc and lmodern. – Davislor Jun 9 '20 at 15:57

If you're getting literally that error—with no visible character after the \u8:—then what's probably happening is that you have some sort of invisible or space unicode character in your document. For instance, on my Mac, if I hit option-space, I get a non-breaking space, which gives an error that looks like that. You also might have some other character; a zero-width breakable space, for instance. If you copied and pasted your error, looking at the source of this page indicates that you might have a soft hyphen in your source (Unicode character 0xAD, representing a valid hyphenation point but not typeset unless there's a word-break). Thus, find the line it's occurring on, and comb through that line until you find it. Retype it if necessary, but a good editor should let you find it. Once you delete it, then your first three methods should work.

When I use your header (commenting out \frechbsetup, which doesn't seem to exist, and using \documentclass{article}), $^{\circ}$ renders as a largeish circle in the superscript position, $\deg$ renders as the upright text "deg", and \textdegree renders as a smaller circle. A literal ° doesn't work by default. To make it work, you can use \DeclareUnicodeCharacter{B0}{\textdegree}. This tells inputenc to treat the Unicode character 0xB0, the °, as though it were \textdegree, which is what you want. You could also use this to see if your problem is the soft hyphen; insert \DeclareUnicodeCharacter{AD}{\Huge [ICI]} to get the text [ICI] rendered into your document in huge letters wherever there's a soft hyphen. (Of course, if there's some other invisible character, you'll just get the error.)

Also, although I've never used it, you could try using XeLaTeX instead of PDFLaTeX; it has full UTF-8 support out of the box.

  • 7
    Indeed, an invisible character seemed to be the source of my problem. Thanks! – levesque Oct 18 '10 at 17:14
  • 7
    No problem. I remember how befuddled I was the first time I ran into this problem; I'm glad I could help someone else out with it. – Antal Spector-Zabusky Oct 18 '10 at 17:35
  • 2
    @AntalS-Z Is there a way to detect which symbol is causing this error ? It is giving this error in the first line where there is plain text. Thanks. – Anusha Oct 15 '14 at 9:40
  • 2
    @Anusha: Not that I can think of off the top of my head – depending on your editor, you could (a) retype the line, (b) step through it with the arrow keys until you hit something strange, (c) turn on some sort of "show invisible characters" setting, or (d) put the file through some sort of shell filter like cat -v or xxd to see where the first wrong character is. – Antal Spector-Zabusky Oct 16 '14 at 20:09
  • 2
    @Anusha: In Emacs, if your document is mostly in ASCII (that is, the basic 26 characters of the Latin alphabet in upper- and lower-case, the 10 digits, and a handful of punctuation), then you could search for a non-ASCII character: C-M-s [ -~] (C-M-s searches for a regular expression, and [ -~] looks matches the printable ASCII range). This will match most possible culprits, in addition to tabs and newlines. – Antal Spector-Zabusky Oct 16 '14 at 20:23



instead of [utf8] solved the problem for me.

  • 12
  • 1
    Adding to Paul Gaborit's comment: This "solves" the problem but introduces ut8x, which is undesirable. This answer should not be upvoted. – facuq Sep 6 '16 at 20:07
  • it doesn't work me:-( – SparkAndShine Dec 14 '16 at 23:03
  • 2
    And I'm getting Package biblatex Error: Incompatible package 'ucs'. \begin{document} – hola Jun 30 '17 at 5:33
  • my pdf is rendering perefectly even with this error. should i still worry about it? – vipin8169 Feb 5 at 5:59

\usepackage{textcomp} is missing.

  • 1
    Adding textcomp worked for me, but so did using $^{\circ}$ in the text. Which is cleaner? – Dave Everitt Aug 31 '15 at 17:19
  • It depends on how often you are going to be using the character. – David Crosswell Apr 16 '19 at 20:23
  • As of 2020, textcomp is integrated into the LaTeX kernel, and no longer needs to be included explicitly. So your solution, which was correct when you posted it, is now applied automatically. – Davislor Jun 9 '20 at 15:59

I got this error after copying a word from my browser and pasting it into my editor. Just retyped it an the problem was solved.

Not the answer you're looking for? Browse other questions tagged or ask your own question.