# Listings Character problem

Hi I want to define a string in Listings but I can not do it in Turkish.

I want to write:

int[] sayılar= new int[5];'

but the output is

int[] saylar= new int[5];

How can I write Ç,ç,ı,ö,ü,ğ?

• – user13907
Aug 12 '14 at 7:33
• if @Papiro's link doesn't help, something like is suggested here might help. Aug 12 '14 at 7:43
• @Jubobs I'll write one right now. Aug 13 '14 at 20:42

This should allow typing the characters you requested - basically adding more to the list of literates will allow other characters as well:

\documentclass[a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{listings}
\lstset{literate=%
{Ç}{{\c{C}}}1
{ç}{{\c{c}}}1
{ı}{{\i}}1
{ö}{{\"{o}}}1
{ü}{{\"{u}}}1
{ğ}{{\u{g}}}1
}

\begin{document}
This is the listing:
\begin{lstlisting}
int[] sayılar= new int[5];
also check: Ç,ç,ı,ö,ü,ğ
\end{lstlisting}
\end{document}

• are you sure about =\true ? Aug 13 '14 at 21:06
• @greyshade Cool. Let's clean up and delete those comments, so. Aug 13 '14 at 21:23