[Tex/LaTex] Greek and English Language in bibliography using utf8 encoding and LaTeX

bibliographiesbibtexgreekinput-encodings

I am creating a document;it's main language beeing greek. What I am trying to do, unsuccessfully is to have bibliography entries in two languages, Greek and English that is.

My code is

\RequirePackage{filecontents}
\begin{filecontents*}{testbib.bib}
@comment Datei testbib.bib

@article{Mayer,
title = "The 11B(p,a)8Be nuclear reaction and 11B(p,p)11B backscattering cross sections for analytical purposes ",
journal = "Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms ",
volume = "143",
number = "3",
pages = "244 - 252",
year = "1998",
note = "",
issn = "0168-583X",
doi = "http://dx.doi.org/10.1016/S0168-583X(98)00383-8",
url = "http://www.sciencedirect.com/science/article/pii/S0168583X98003838",
author = "M. Mayer and A. Annen and W. Jacob and S. Grigull",
language  ="English",
hyphenation="english"
}

@Mastersthesis{Vpaneta,
    author = "Συγγραφέας",
    title  = "Τίτλος",
    year   = "2012",
    month  = "μήνας",
    school = "Κατι",
    language  ="Greek",
    hyphenation="greek"
}
\end{filecontents*}

\documentclass[11pt,a4paper]{book}

\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[unicode]{hyperref}
% \usepackage[bibencoding=auto,backend=biber,babel=other]{biblatex}
% \addbibresource{testbib.bib}

\newcommand{\sw}{\selectlanguage{english}}
\newcommand{\sq}{\selectlanguage{greek}}
\newcommand{\eng}[1]{\latintext#1\greektext}
\newcommand{\gre}[1]{\greektext#1\latintext}

\begin{document}
 \tableofcontents
 \chapter{Κεφάλαιο}
  \section{Ενότητα}
  σδφγηξκλ\cite{Mayer}hgfkhgjfkhgfkhg\cite{Vpaneta}
  \section{Ενότητα}
 \addcontentsline{toc}{chapter}{Βιβλιογραφία}
  \bibliographystyle{plain}
  %\selectlanguage{english}
  \bibliography{testbib}
  %\printbibliography
\end{document}

Preferably I would like to use utf8 encoding in order to have greek contents in the pdf viewer. However when using utf8 encoding there's no way to produce the .pdf file. There are errors stating that

Package inputenc Error: Unicode char \u8:��2 not set up for use with LaTeX

therefore I have to use iso-8859-7 encoding. Note that I change my editor's encoding accordingly.

What can I do to prefferably use a utf8 encoding to create the bibliography and use 2 different languages or as a last solution to use iso-8859-7 encoding to create in the same way(i.e. using 2 languages) the bibliography?

My output using iso-8859-7 encoding is

enter image description here

When changing the language to English the output is

enter image description here

Best Answer

you don't need to use XeLaTeX with biblatex, it works with pdflatex too. You sample compiles fine for me with pdflatex, utf8 option of fontenc, biblatex and biber for unicode bibliography support, and fontenc package with T1 and LGR options for font support (although it seems it works even without fontenc):

\RequirePackage{filecontents}
\begin{filecontents*}{testbib.bib}

@article{Mayer,
title = "The 11B(p,a)8Be nuclear reaction and 11B(p,p)11B backscattering cross sections for analytical purposes ",
journal = "Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms ",
volume = "143",
number = "3",
pages = "244 - 252",
year = "1998",
note = "",
issn = "0168-583X",
doi = "http://dx.doi.org/10.1016/S0168-583X(98)00383-8",
url = "http://www.sciencedirect.com/science/article/pii/S0168583X98003838",
author = "M. Mayer and A. Annen and W. Jacob and S. Grigull",
language  ="English",
hyphenation="english"
}

@Mastersthesis{Vpaneta,
    author = "Συγγραφέας",
    title  = "Τίτλος",
    year   = "2012",
    month  = "μήνας",
    school = "Κατι",
    language  ="Greek",
    hyphenation="greek"
}
\end{filecontents*}

\documentclass[11pt,a4paper]{book}

\usepackage[english,greek]{babel}
\usepackage[T1,LGR]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[unicode]{hyperref}
 \usepackage[bibencoding=auto,backend=biber,babel=other]{biblatex}
 \addbibresource{testbib.bib}

\newcommand{\sw}{\selectlanguage{english}}
\newcommand{\sq}{\selectlanguage{greek}}
\newcommand{\eng}[1]{\latintext#1\greektext}
\newcommand{\gre}[1]{\greektext#1\latintext}

\begin{document}
 \tableofcontents
 \chapter{Κεφάλαιο}
  \section{Ενότητα}
  σδφγηξκλ\cite{Mayer}hgfkhgjfkhgfkhg\cite{Vpaneta}
  \section{Ενότητα}
 \addcontentsline{toc}{chapter}{Βιβλιογραφία}
 % \bibliographystyle{plain}
  \selectlanguage{english}
  %\bibliography{testbib}
  \printbibliography
\end{document}

compile it with

 pdflatex filename.tex
 biber filename
 pdflatex filename.tex

and of course, file filename.tex must be in utf8 encoding enter image description here