\HeaderA{showNonASCII}{Highlight non-ASCII characters}{showNonASCII}
\keyword{utilities}{showNonASCII}
\begin{Description}\relax
This function prints elements of a character vector which contain
non-ASCII bytes, printing such bytes as a escape like \code{<fc>}.
\end{Description}
\begin{Usage}
\begin{verbatim}
showNonASCII(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a character vector.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This was originally written to help detect non-portable text in
files in packages.

It prints all lines of the files which contain non-ACII characters,
preceded by the line number and with non-ASCII bytes highlighted
\emph{via} \code{\LinkA{iconv}{iconv}(sub = "byte")}.
\end{Details}
\begin{Examples}
\begin{ExampleCode}
out <- c(
"fa\xE7ile test of showNonASCII():",
"\\details{",
"   This is a good line",
"   This has an \xfcmlaut in it.",
"   OK again.",
"}")
cat(out, file = "my.Rd", sep = "\n")

showNonASCII(readLines("my.Rd"))
unlink("my.Rd")
\end{ExampleCode}
\end{Examples}

