3

I am starting to use biber with biblatex for my bibliography. I cite books in French and Spanish therefore several books and articles have accented letters in titles or author's names. I hadn't had any problem compiling my .bib file, which I have been using for two now, with bibtex. But now with biber there seems to be problems with some of my entries, not all though.

I am using TexShop and compile with Latex.

Here you'll find some lines from my preamble that might be relevant:

\usepackage[british]{babel} 
\usepackage{csquotes} 
\usepackage[backend=biber,style=authoryear]{biblatex}

 \addbibresource{MyBib.bib}

 \usepackage[colorlinks, allcolors=blue, breaklinks]{hyperref}
  \begin{document}
  \autocite{key}

  \end{document}

When I run the bibtex (the graphic option is called bibtex buy I am using biber as backend) I get the following message at the very beginning:

"\x{fffd}" does not map to ascii at /var/folders/1t/gfg6lx791ds0hfh1hxskk8y40000gp/T/par-696675636873/cache-955b5cd96386991ca6623279060097e4c757d28e/inc/lib/Biber/Utils.pm line 932.

Trying to compile with Latex again I get the message:

Undefined control sequence. St\x{fffd}phanie

This argument corresponds to the author name in one of my entries. I modified the entry as shown below:

St{\'e}phanie

in my .bib (JabRef), but this does not solve the issue.

What can I do? And is there a way of finding a solution that does not involve going through my entire bibliography database changing characters one by one?

  • Biber should be able to do this reencoding for you: Take a document that \nocite{*}s all the entries; run latex on it so a .bcf is created; then biber -output_encoding=UTF-8 --output_format=bibtex <yourfile>.bcf should output a file called <yourfile>_biber.bib. – jon Jan 10 '14 at 15:31
  • 1
    Also: are you using traditional pdfTeX or XeTeX/LuaTeX as the engine? The former probably requires an explicit setting of fontenc, inputenc (I recommend [T1]{fontenc} and [utf8]{inputenc}` unless you need something particular), and then loading the appropriate options for biblatex; the latter means you are using fontspec. – jon Jan 10 '14 at 15:37
  • @jon Thanks for the comments. 1. When you tell me to biber -output .... Do I need to do this from the terminal?. Also I have hundreds of refs, is there really no other way of correcting my .bib in a less tedious manner rather than \nociting every single key? Finally, what you suggest is that I replace my .bib by the one generated in the way you say? – I-G Jan 13 '14 at 9:01
  • @I-G The \nocite{*} command does nocite all your .bib entries: the * is like a wildcard. So you don't need to enter each key manually. – Alan Munn Jan 13 '14 at 12:44
  • I can post as an answer if you think this will be a viable solution. I didn't do so earlier because I wasn't sure if you wanted a converted .bib. My advice would be to use a UTF8 .bib file if you can use Biber most of the time, and then use biber to convert to an ASCII version (with {\'a}cc{`e}nts, etc.) when BibTeX is required. That way you only need to maintain one .bib file. – jon Jan 13 '14 at 15:18
3

This sort of thing is easily solved if you are using biber. As it uses UTF-8 by default, there is good reason to use the same encoding in your bib file. That is, to use é rather than the traditional (Bib)TeX method of writing {\'e}.

Of course, if you ever need to use BibTeX on the existing .bib file, you'll run into problems if it is UTF-8. However, biber can easily fix that for you:

biber --tool --output_encoding=ascii inputfile.bib

This will produce a file called inputfile_biber.bib, which should be ready for use with traditional BibTeX.

In the case above, it looks like biber is feeding you a .bbl that is UTF-8, but your document is using the traditional OT1 encoding, which has little to recommend it nowadays. For most Latin-alphabet-based documents that rely on the pdfTeX engine (i.e., compiling your document with latex or pdflatex), I recoomend you use:

\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc}

(This problem shouldn't normally have arisen if you use XeTeX (xelatex) or LuaTeX (lualatex) to compile your document...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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