# How to avoid change of ' to ’ in a code listing?

I want that my PDF document contains a code snippet that looks like this:

char charValue = 'X';


I am using this code here:

\begin{lstlisting}[language=java,escapechar=|]
char charValue = 'X';
\end{lstlisting}


Unfortunately, the output in the PDF looks like this:

char charValue = ’X’;


' has been changed to ’

How can this be avoided?

\documentclass{article}