\section{Plaintext}
\begin{frame}
	\frametitle{Plaintext}
	\begin{itemize}
		\item \LaTeX\ ist kein WYSIWYG-Editor
		\item \LaTeX\ $\ \neq$ OpenOffice, Word, ...
		\item WYSIWYG -- What You See Is What You Get
		\item Plaintext: einfacher Text, ohne unsichtbare Zusatzinformationen (wie Quelltext)
	\end{itemize}
	
	\begin{exampleblock}{Abbildung von Buchstaben auf Binärzahlen}
	\begin{itemize}
		\item ASCII
		\item latin1 (ISO 8859-1)
		\item latin9 (ISO 8851-15)
		\item UTF-8
	\end{itemize}
	\end{exampleblock}
\end{frame}

\begin{frame}[fragile]
	\frametitle{ASCII}
	\begin{longtable}{|c|c|c|c||c|c|c|c|}
	\hline
	Dez & Hex & Okt & Zeichen & Dez & Hex & Okt & Zeichen\\
	\hline
	64 & 0x40 & 100 & @ & 96 & 0x60 & 140 & ` \\
	65 & 0x41 & 101 & A & 97 & 0x61 & 141 & a \\
	67 & 0x43 & 103 & C & 99 & 0x63 & 143 & c \\
	68 & 0x44 & 104 & D & 100 & 0x64 & 144 & d \\
	69 & 0x45 & 105 & E & 101 & 0x65 & 145 & e \\
	70 & 0x46 & 106 & F & 102 & 0x66 & 146 & f \\
	72 & 0x48 & 110 & H & 104 & 0x68 & 150 & h \\
	\hline
	\end{longtable}
	
	\begin{verbatim}
$ cat hello_world.txt 
Hello World
Hallo Welt!
$ hexdump -C hello_world.txt 
48 65 6c 6c 6f 20 57 6f 72 6c 64 0a
48 61 6c 6c 6f 20 57 65 6c 74 21 0a
	\end{verbatim}
\end{frame}


\begin{frame}[fragile]
	\frametitle{Where are the umlauts?}
	Darstellbar durch ASCII
	\begin{small}
	\begin{verbatim}
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~ 
	\end{verbatim}
	\end{small}

	Nicht darstellbar: Umlaute, deutsche Sonderzeichen etc.
	\begin{small}
	\begin{verbatim}
$ echo -n ä | iconv --from=utf-8 --to=ascii | hexdump -C
iconv: illegal input sequence at position 0
	\end{verbatim}
	\end{small}

\end{frame}

\begin{frame}[fragile]
	\frametitle{UTF-8 ftw}	
	
	Erweiterte Codierung wird benötigt
	\begin{tiny}
	\begin{alltt}
$  echo -n ä | iconv --from=utf-8 --to=latin1 | hexdump -C 
e4
$  echo -n ä | iconv --from=utf-8 --to=iso-8859-1 | hexdump -C
e4
$  echo -n ä | iconv --from=utf-8 --to=iso-8859-15 | hexdump -C
e4
$ echo -n € | iconv --from=utf-8 --to=iso-8859-1 | hexdump -C
iconv: illegal input sequence at position 0
$  echo -n € | iconv --from=utf-8 --to=iso-8859-15 | hexdump -C
a4 
$ echo -n \(\Phi\) | iconv --from=utf-8 --to=iso-8859-15 | hexdump -C
iconv: illegal input sequence at position 0
	\end{alltt}
	\end{tiny}

	\begin{small}
	\begin{alltt}
$ echo -n ä\(\Phi\)€ | iconv --from=utf-8 --to=utf-8 | hexdump -C
c3 a4 ce a6 e2 82 ac
	\end{alltt}%$ -- texmaker stinkt
	\end{small}
	
	ä$\Phi$€ -- UTF-8 for the win!
\end{frame}

\begin{frame}[fragile]
	\frametitle{Konfiguration}
	\framesubtitle{Oder: Woran merkt der Rechner eigentlich, dass ich UTF-8 mit ihm sprechen will?}
	
	Für Textdokumente muss explizit spezifiziert werden, um welches Encoding es sich handelt.
	\begin{itemize}
		\item Texmaker: Optionen $\rightarrow$ Texmaker konfigurieren $\rightarrow$ Editor $\rightarrow$ Fontkodierung: UTF-8
		\item \LaTeX-Dokument: \begin{verbatim}\usepackage[utf8x]{inputenc}\end{verbatim}
		\item HTML-Dokument: \begin{verbatim}<meta http-equiv="Content-Type"
		content="text/html;charset=utf-8">\end{verbatim} bzw. der entsprechende HTTP"=Header
	\end{itemize}
\end{frame}


\begin{frame}[fragile]
	\frametitle{UTF-8: Bemerkungen}
	\begin{itemize}
		\item Es gibt einen Pseudo-UTF-8-"`header"' für Textdokumente
		\begin{itemize}		
			\item \texttt{EF BB BF}
			\item aka Byte Order Mark, eigentlich nur für UTF-16 und UTF-32
			\item primär in der Windowswelt zu finden
			\item nicht druckbare UTF-8-Zeichen um Encoding zu markieren
			\item \texttt{ï»¿} falls als ASCII dekodiert
		\end{itemize}
		\item oft gesehen: UTF-8 \texttt{ä} interpretiert als ASCII \texttt{\~{A}}\currency
		\item UTF-8 verwendet sogenannte "`surrogates"':\\1 Zeichen $\geq$ 1 byte
		\item Bsp.: \texttt{ä = C3 A4}
	\end{itemize}
\end{frame}

