# ï & î font encoding

I've one problem in my scrbook, ï and î don't work when I compile my \printbibliography. But the problem come only with these 2 accents…

I export my .bib from Papers2 for Mac application, & I use TexShop, UTF8 encoding, & I'm newbie with Biber & Biblatex.

My ref :

@book{GoncalvesdaCosta:2000tw,
author = {Goncalves Da Costa, H{\'e}lo{\"\i}sa},
title = {{Les mus{\'e}es d'histoire de ville leur contribution au d{\'e}veloppement social contemporain.}},
publisher = {Universit{\'e} du Qu{\'e}bec {\a} Montr{\'e}al},
year = {2000},


My minimal config :

% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{scrbook}

\usepackage[english,frenchb]{babel}
\usepackage[quiet]{fontspec}

\usepackage[automark]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes}
\usepackage[backend=biber,style=authortitle-ticomp,doi=false]{biblatex}

\frenchbsetup{FrenchFootnotes=false}
\MakeOuterQuote{"}

\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}

\AtBeginBibliography{\def\UrlFont{\scriptsize}}

\begin{document}
"Héloïse"\footcite{GoncalvesdaCosta:2000tw}.
\printbibliography
\end{document}

-
If I use another font, the characters are correct. Try with “Linux Libertine O” instead of “Adobe Garamond Pro”, just to see whether it's a font problem or not. –  egreg Feb 4 '14 at 16:21
Hi @egreg I try with "Garamond", same problem (I don't have "Linux Libertine O"), but with "Arial" it's ok, why ? I think the problem come from my new use of biber & UTF8 encodings… Hope I can continue with my font. –  Zouib Feb 4 '14 at 18:15

Biber does not understand {\"\i}. Fix the encoding with recode:

recode -d latex..UTF-8 biblio.bib


The problem seems to be the string {\"\i} (which is meant to represent ï) in your bibliography. Biber gets confused and interprets it as {\"ı}, which is nonsense, and in turn, responsible for the bad output.

So the question is, what to do with the offending character? There are two general answers:

1. Change the way your bibliography gets processed
2. Remove the offending string from your bibliography

1. Change how the bibliography is processed

1.1 Call biber with --output_safechars.

To force biber to pass {\"\i} along unchanged, and thus getting the correct output, simply use the option --output_safechars:

xelatex document
biber --output_safechars document
xelatex document
xelatex document


1.2. Use bibtex8 as backend.

BibTeX does not modify {\"\i} in the process and it can be used with 'BibLaTeX'. (It is possible but not recommended using BibTeX instead of biber, because a lot of the advanced features will work only with the latter.) To do so set the option backend=bibtex8. Your MWE would look like this:

% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{scrbook}

\usepackage[english,frenchb]{babel}
\usepackage[quiet]{fontspec}

\usepackage[automark]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes}
\usepackage[backend=bibtex8,style=authortitle-ticomp,doi=false]{biblatex} % <-- changed backend

\frenchbsetup{FrenchFootnotes=false}
\MakeOuterQuote{"}

\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}

\AtBeginBibliography{\def\UrlFont{\scriptsize}}

\begin{document}
"Héloïse"\footcite{GoncalvesdaCosta:2000tw}.
\printbibliography
\end{document}


To compile the document call:

xelatex document
bibtex document
xelatex document
xelatex document


Both ways produce PDFs with correctly rendered ï:

2. Prevent {\"\i} from ending up in bibliography

2.1. Change the exported bibliography

The general approach would be replacing all occurrences of \"\i in your bibliography with \"i. This could be done with any text editor capable of searching and replacing strings. Of course there are tools to do that for you. sed is one of them:

sed s/\\"\\i/\\"i/g  < in.bib > out.bib


Don't worry, there are others beside sed. The best tool on the command line es of course recode, all you have to do is:

recode -d latex..UTF-8 biblio.bib


(Unfortunately recode does not come preinstalled with Mac OS X, but it can be easily installed with Homebrew.)

As you are on a Mac, you could use BibDesk:

1. Open your bibliography with BibDesk:

1. Export (Menu --> File --> Export...) as BibTeX and Unicode (UTF-8):

This will provide you with a valid UTF-8 BibLaTeX compatible file:

%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/

%% Created for you at 2014-02-11 23:42:00 +0000

%% Saved with string encoding Unicode (UTF-8)

@book{GoncalvesdaCosta:2000tw,
Author = {Goncalves Da Costa, Héloïsa},
Publisher = {Université du Québec à Montréal},
Title = {{Les musées d'histoire de ville leur contribution au développement social contemporain.}},
Year = {2000}}


2.2. Use software capable of exporting BibLaTeX

Maybe you should ditch Papers and switch to JabRef, BibDesk, Mendeley, Zotero, vim or emacs.

-
Hi @DG' thanks for your analyse, it produces effectively {\"ı} I try with bibtex8, but no change in my pdf. I don't know how calling your biber option… In command line ? Maybe, I can change the encoding when I create my .bib from Papers, but it purpose only : bibtex, xml endnote, reman RIS… So I chose obviously bibtex –  Zouib Feb 5 '14 at 11:59
I find it in is.gd/mhZTCL (qandasys.info Audrey) : "A quick way to do this is to re-encode your bib file to Ascii with: biber --tool --output_encoding=ascii --output_safechars <file name>.bib" I try, but the problem persists… –  Zouib Feb 5 '14 at 12:39
@Zouib have you tried compiling the document manually (maybe TeXShop calls biber instead of bibtex8)? If not, open a terminal, cd to your working directory and run latexmk -xelatex yourfile –  DG' Feb 5 '14 at 12:40
Have you deleted all the temporary files (.aux, .bbl, etc.)? –  DG' Feb 5 '14 at 12:43
Sorry to hear that. There is another way: open your file with bibdesk and save as UTF-8. PS: Papers is indeed known for all kinds of problems... –  DG' Feb 11 '14 at 18:45

With LuaTeX the glyph isn't available for Garamond Regular. I tried it with the Garamond Pro and Garamond Premier Pro. Only the italic and bold variant show the character. But EBGaramond has it:

If I run the example with xelatex instead of lualatex then everything is fine with AGaramondPro, too:

As Enrico said, use another font if you do not have the EBGaramond, at least for the bibliography. However, you can write your bibliography with unicode characters:

@book{GoncalvesdaCosta:2000tw,
author = {Goncalves Da Costa, Héloïsea},
title = {Les musées d'histoire de ville leur contribution au développement social contemporain.},
publisher = {Université du Québec à Montréal},
year = {2000},

without history nobody knows what this might be: {\"i} –  Herbert Feb 4 '14 at 17:03
@Zouib: you should use this notation: {\"i} or {\"{\i}} but _not_ {\"\i}. –  Herbert Feb 4 '14 at 18:33