# "Package inputenc Error: Invalid UTF-8 byte sequence" on the .bbl file

Package inputenc Error: Invalid UTF-8 byte sequence. \bibinfo{author}{Budulan, �.}


I got the above error where it has something to do with the .bbl file.

Upon checking, the line has this error:

\bibinfo{author}{Budulan, �.}, \bibinfo{author}{Burceanu, E.},


The author's name is spelt as Budulan, Ştefania. See the letter S.

What does it mean and what should I do?

• Go to your .bib file and search for Budulan. Apparently there is something wrong with the given name of Budulan in one of your entries. May 29, 2020 at 4:12
• @moewe the author's name is spelt as Budulan, Ştefania, See the letter S
– Aqee
May 29, 2020 at 6:03
• If you are using BibTeX then please keep in mind that BibTeX is not Unicode aware and can only deal with US-ASCII characters. This is usually not a problem, since characters are passed through as they are, but for initials generation that could be a problem if the characters are read byte-wise. In BibTeX you should probably write {\c S}tefania instead of Ştefania (see also tex.stackexchange.com/q/57743/35864). If you use a the unicode-aware Biber (only usable together with biblatex), Ş should just work. May 29, 2020 at 6:06
• how did you find which line is the one to blame? I have a similar error and I don't know which line in the bib file makes the error. ! Package inputenc Error: Invalid UTF-8 byte sequence.See the inputenc package documentation for explanation.Type H <return> for immediate help.... \end{frame} Oct 26, 2020 at 16:46

BibTeX cannot deal with Unicode characters outside the US-ASCII range. Often that does not become apparent when you just look at the output in the document, since BibTeX usually just passes the characters thorough as they are. But when you ask BibTeX to perform string manipulation or sorting it can become painfully obvious that BibTeX doesn't know how to deal with non-US-ASCII characters. Shortening of first names is one of those operations.

I did not manage to reproduce the exact error from your question, but here is an example of Ş misbehaving twice. In BibTeX you'll have to use the macro escape {\c S} instead. See also How to write “ä” and other umlauts and accented letters in bibliography?.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{natbib}
\bibliographystyle{abbrvnat}

\begin{filecontents}{\jobname.bib}
author  = {Budulan, Ştefania},
title   = {Bad -- Unicode (Ş S)},
year    = {1980},
}
@article{budulan:good,
author  = {Budulan, {\c S}tefania},
title   = {Good -- macro escape ({\c S} S)},
year    = {1980},
}
\end{filecontents}

\begin{document}
\bibliography{\jobname}
\end{document}


With biblatex you could use Biber as a backend, which deals with Unicode out of the box.

As David points out in the comments, the symptoms in the question could be explained by using non-ASCII characters and a different (assumed) encoding for the .bib file and .tex file (latin2 for the .bib and UTF-8 for the .tex file). With BibTeX you need to make sure that the .bib and .tex file encodings match. But as I said before, BibTeX doesn't really accept anything but US-ASCII.

If your .bib file is written by a third-party tool, you need to configure that tool to use a compatible encoding, but you should also instruct the tool to use macro-escapes for non-ASCII characters.

• I would guess the actual error is that the bib file is in latin2 not utf-8 so the OP would need to fix that in any case (but using a system that knows how to sort the names properly would be a good plan:-) May 29, 2020 at 9:49
• @DavidCarlisle, I have to change to UTF-8 on every run. Is there to just make it UTF-8 forever?
– Aqee
Dec 22, 2020 at 9:39
• @Aqee you mean you are generating a latin2 bib file from something else? Most likely if you said how you were generating it someone could tell you how to make it default to utf-8. Otherwise, I don't understand your comment If you save the bib file in UTF-8 none of latex, bibtex, or biber will change the file at all so it will stay that way so what do you need to change every run? Dec 22, 2020 at 10:11
• @DavidCarlisle Sorry! I forgot to mention that the BibTeX file was generated automatically by Mendeley and will also be updated automatically by the software if new documents have been uploaded.
– Aqee
Dec 22, 2020 at 11:48
• @Aqee then that's a mendeley-specific question, I assume it's possible to configure but I have never used it so can't help, sorry. Dec 22, 2020 at 12:00