# Print a speacial character read by \readline in the same way in the document

I want to read a underscore character from a file with \readline and print it as an underscore in the resulting pdf. But the result is a high point. I've read quite a lot about category/character codes but it is still quite confusing.

I've found this related question: \chardef and underscore, but I would prefer not changing the font.

Here the minimal working example:

\documentclass[12pt]{article}
\usepackage{xstring}
\usepackage{filecontents}
\begin{filecontents*}{data.txt}
_
\end{filecontents*}

\begin{document}
\StrLeft{\line}{1}[\firstletter]

The content of firstletter should be printed here: \firstletter

But it should be displayed as: \_
\end{document}

-

You can use the Cork (T1) encoding:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{xstring}
\usepackage{filecontents}
\begin{filecontents*}{data.txt}
_
\end{filecontents*}

\begin{document}