Although there are already some discussions on this issue, I can't get any of the proposed solutions to work for me.
Take this document and compile it with xelatex:
\documentclass[12pt,a4paper,parskip=half+,ngerman]{scrartcl}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{german}
\usepackage[babel,german=quotes]{csquotes}
\usepackage{listings}
\setmonofont{Consolas}
\lstset{
breaklines=true,
extendedchars=true,
frame=single,
keepspaces=true,
showspaces=false,
showstringspaces=false,
}
\begin{document}
Test
\lstinputlisting[language=SQL,numbers=none,firstline=1,lastline=1]{code.sql}
Test
\lstinputlisting[language=SQL,numbers=none,firstline=2,lastline=2]{code.sql}
Test
\lstinputlisting[language=SQL,numbers=none,firstline=3,lastline=3]{code.sql}
Test
\lstinputlisting[language=SQL,numbers=none,firstline=4,lastline=4]{code.sql}
\end{document}
Code.sql:
Adélaïde de Maiziére
Mikuláš Frashëri
Petrė Meier
Şimşek Đurić
The result looks like this:

I tried the suggestion from The 'listings' package and UTF-8 and copied the given code into my document (do I maybe need to customize the hex-codes? What do they mean?). The result stays exactly the same.
Then, I tried the solution using literate from Having problems with listings and UTF-8. Can it be fixed? by adding the following line:
literate={á}{{\'a}}1 {é}{{\'e}}1 {Ş}{{\c S}}1 {ş}{{\c s}}1 {ć}{{\'c}}1 {ï}{{\"i}}1 {Đ}{{D}}1 {š}{{s}}1,
The result (note the additional spacing in the first line and the incorrect handling of the other characters).

What can I do?
^^^^20ac^^^^0153^^^^0152% nouveau pour xetexwith more code. E.g.^^^^20acis for the euro sign (U+20AC). For "s cedille" (U+015F) you would have to add ^^^^015F. It is also possible to enter the chars directly€Œœ% nouveau pour xetex. The code works only if you use extendedchars=true! – Ulrike Fischer Mar 11 '14 at 09:09