% arabdoch.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Alternate input encodings}\label {scanners}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ASMO 449 = ISO 9036}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The file \verb"asmo449.sty" contains a reading module for the
ASMO 449 code (identical to ISO 9036).
It is installed by the \LaTeX\ option \verb"asmo449"
or by \verb"\input asmo449.sty".
The module is activated by \verb"\setcode {asmo449}"
or \verb"\setcode {iso9036}"; all following Arabic text will be
considered to be coded according to the ASMO 449 standard.
The \ArabTeX\ notation may be reactivated by \verb"\setcode {arabtex}".
                                                  \index{code!ASMO 449}
                                                  \index{ASMO 449}
                                                  \index{code!ISO 9036}
                                                  \index{ISO 9036}
                                                  \index{\setcode{asmo449}}
                                                  \index{\setcode{iso9036}}
                                                  \index{\setcode{arabtex}}

ASMO 449 (see Table~\ref{asmo449}) 
is a 7-bit code, differing from ASCII (ISO 646) mainly by
replacing the letters by the Arabic letter characters and diacritical
marks; the Arabic digits share their positions with the ASCII digits.
The positions of special and control characters in both codes
are identical.
                                                  \index{code!ASCII}
                                                  \index{code!ISO 646}
                                                  \index{ISO 646}
                                                  \index{ASCII}
                                                  \index{code!7-bit}

A minimal driver file for processing, e.g. a file \verb"asmotext.dat",
could be structured as follows:

\begin{verbatim}
\documentstyle [arabtex,asmo449]{article}
\begin {document}
\setcode {asmo449}
\begin {arabtext}
\input asmotext.dat

% the preceding blank line is required if "asmotext.dat" did not
% end with a blank line itself; this is strange and embarrassing
\end {arabtext}
\end {document}
\end{verbatim}

As texts coded in ASMO 449 are always rendered verbatim the commands
\verb"\novocalize", \verb"\vocalize", \verb"\fullvocalize" 
and the language selection commands 
\verb"\setarab" etc. make no sense and are temporarily disabled.

Texts in ASMO 449 are usually not fully vowelized.
Thus the transliteration cannot be expected to be correct.
This is especially true for Egyptian texts which commonly do not 
differentiate between \yah\ and \alif\ \maqsura.

%\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{ASMO 449E = ISO 8859 - 6}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The file \verb"iso88596.sty" contains a reading module for the
ISO 8859-6 code (extended ASMO 449 = ASMO 449E).
It is installed by the \LaTeX\ option \verb"iso88596"
or by \verb"\input iso88596.sty".
The module is activated by \verb"\setcode {iso8859-6}";
all following Arabic text will be considered to be coded according to
the ISO 8859-6 standard.
The \ArabTeX\ notation may be reactivated by \verb"\setcode {arabtex}".
                                                  \index{code!ISO 8859-6}
                                                  \index{ISO 8859-6}
                                                  \index{code!8-bit}
                                                  \index{\setcode{iso8859-6}}
                                                  \index{\setcode{arabtex}}

ISO 8859-6 (see Table~\ref{iso8859-6})
is an 8-bit code closely related both to 7-bit ASCII
and to ASMO 449; whereas the lower 128 positions are identical to
ASCII (ISO 646), the upper 128 positions contain the Arabic characters
of ASMO 449 in the analogous places, 
plus a few additional graphic and control characters.
                                                  \index{code!ASMO 449}
                                                  \index{ASMO 449}
                                                  \index{code!ASCII}
                                                  \index{code!ISO 646}
                                                  \index{ISO 646}
                                                  \index{ASCII}

We exploit the close relationship of these codes by reusing the ASMO 449
reading routines, after suitable modification of the input. 
This only works correctly if the input text does not contain 
genuine ASCII letters, as we
project the Arabic characters onto their locations in ASMO 449. 
Some of the code switching messages in the log file are spurious; 
do not worry.

The notes on vowelization and transliteration of ASMO 449 apply also.

The driver file indicated for ASMO 449 will be usable after the
obvious modifications; however, your \TeX\ installation must be
capable of processing 8-bit data input.
This is nowadays usually the case; otherwise you can try to
locally find some utility program that will strip the highest order bit
off the characters in your file, and process the result via ASMO 449.

\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{table}[htbp]
\begin{center}
\novocalize \setarab

\def \hb #1{\hbox to 9mm{\hss #1\hss }}

\begin{tabular}
{|c||c|c|c|c|c|c|c|c@{ \vrule height 15pt depth 9pt width 0pt}||}
\hline
   &\hb 0&\hb 1&\hb 2&\hb 3 &\hb 4   &\hb 5  &\hb 6   &\hb 7    \\
\hline
\hline
00 & NUL & DLE & SP  & \<0> &  @     & \<_d> &\<B|B|B>& \<|B"i> \\
\hline
01 & SOH & DC1 & !   & \<1> & \<-'>  & \<r>  & \<f>  & \<|BB>   \\
\hline
02 & STX & DC2 & "   & \<2> & \<'A>  & \<z>  & \<q>  & \<|B">   \\
\hline
03 & ETX & DC3 & \#  & \<3> & \<'a>  & \<s>  & \<k>  & \<|BB"aN>         \\
\hline
04 & EOT & DC4 & \$  & \<4> & \<w"'> & \<^s> & \<l>  & \<|BB"uN>         \\
\hline
05 & ENQ & NAK & \%  & \<5> & \<'i>  & \<.s> & \<m>  & \<|BB"iN>         \\
\hline
06 & ACK & SYN & \&  & \<6> & \<Y"'->& \<.d> & \<n>  & \<|BB"a>         \\
\hline
07 & BEL & ETB &  '  & \<7> & \<a>   & \<.t> & \<h>  & \<|BB"u>         \\
\hline
08 & BS  & CAN &  )  & \<8> & \<b>   & \<.z> & \<w>  & \<|BB"i>         \\
\hline
09 & HT  & EM  &  (  & \<9> & \<T>   & \<`>  & \<Y>  &          \\
\hline
10 & LF  & SUB & $*$ &   :  & \<t>   & \<.g> & \<y>  &          \\
\hline
11 & VT  & ESC & $+$ & \<;> & \<_t> &\verb"]"&\<|B"aN>&\verb"}" \\
\hline
12 & FF  & IS4 & \<,>&  $>$ & \<^g> &\verb"\"&\<|B"uN>&\verb"|" \\
\hline
13 & CR  & IS3 & $-$ &  $=$ & \<.h> &\verb"["&\<|B"iN>&\verb"{" \\
\hline
14 & SO  & IS2 &  .  &  $<$ & \<_h> &\verb"^"&\<|B"a> &\verb"~" \\
\hline
15 & SI  & IS1 &  /  & \<?> & \<d>  &\verb"_"&\<|B"u> & DEL     \\
\hline
\end{tabular}
\end{center}
\caption{ASMO 449 code table}\label{asmo449}
\end{table}

\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{table}[htbp]
\begin{center}
\novocalize \setarab
\small \tabcolsep 4.5pt

\def \sun {% sun symbol
\unitlength 0.2em
\begin{picture}(4,4)(-1.4,-1.2)
\put(0.6,0.2){\circle{1.6}}
\put(+1.0,+1.0){.}  \put(+1.0,-1.0){.}
\put(-1.0,-1.0){.}  \put(-1.0,+1.0){.}
\put(+0.8,+0.8){.}  \put(+0.8,-0.8){.}
\put(-0.8,-0.8){.}  \put(-0.8,+0.8){.}
\end{picture}}

\def \mc #1{\multicolumn{2}{c|}{#1}}

\begin{tabular}
{|c||@{}c@{}|@{}c@{}|c|@{}c@{}|@{}c@{}|c|c|c|c|c|c|@{}c@{}|c|c|c|c|@{}c@{%
\vrule height 15pt depth 9pt width 0pt}||}
\hline
   & 00& 01& 02&\mc{03}&04&05 &06&07&08&09&10&11&12&  13  &  14   &  15 \\
\hline
\hline
00 &NUL&DLE&SP &0& \<0> &@& P & ` & p && &NBSP& & & \<_d> &\<B|B|B>&\<|B"i>\\
\hline
01 &SOH&DC1&!  &1& \<1> &A& Q & a & q &&&&& \<-'>  & \<r>  & \<f>  &\<|BB> \\
\hline
02 &STX&DC2&"  &2& \<2> &B& R & b & r &&&&& \<'A>  & \<z>  & \<q>  &\<|B"> \\
\hline
03 &ETX&DC3&\# &3& \<3> &C& S & c & s &&&&& \<'a>  & \<s>  & \<k> &\<|BB"aN>\\
\hline
04 &EOT&DC4&\$ &4& \<4> &D& T & d & t &&&\sun&&\<w"'>& \<^s>& \<l>&\<|BB"uN>\\
\hline
05 &ENQ&NAK&\% &5& \<5> &E& U & e & u &&&&& \<'i>  & \<.s> & \<m> &\<|BB"iN>\\
\hline
06 &ACK&SYN&\& &6& \<6> &F& V & f & v &&&&& \<Y"'->& \<.d> & \<n> &\<|BB"a>\\
\hline
07 &BEL&ETB& ' &7& \<7> &G& W & g & w &&&&& \<a>   & \<.t> & \<h> &\<|BB"u>\\
\hline
08 &BS &CAN& ) &8& \<8> &H& X & h & x &&&&& \<b>   & \<.z> & \<w> &\<|BB"i>\\
\hline
09 &HT &EM & ( &9& \<9> &I& Y & i & y &&&&& \<T>   & \<`>  & \<Y> &       \\
\hline
10 &LF &SUB&$*$&\mc{:}  &J& Z & j & z &&&&& \<t>   & \<.g> & \<y> &       \\
\hline
11 &VT &ESC&$+$&\mc{;}  &K&\verb"]"&k&\verb"}"&&&&\<;>&\<_t>&&\<|B"aN>& \\
\hline
12 &FF &IS4& , &\mc{$>$}&L&\verb"\"&l&\verb"|"&&&\<,>&&\<^g>&&\<|B"uN>& \\
\hline
13 &CR &IS3&$-$&\mc{$=$}&M&\verb"["&m&\verb"{"&&&SHY& &\<.h>&&\<|B"iN>& \\
\hline
14 &SO &IS2& . &\mc{$<$}&N&\verb"^"&n&\verb"~"& & & & &\<_h>&&\<|B"a> & \\
\hline
15 &SI &IS1& / &\mc{?}  &O&\verb"_"&o&  &  & & & \<?> &\<d> &&\<|B"u> & DEL\\
\hline
\end{tabular}
\end{center}
\caption{ISO 8859-6 code table}\label{iso8859-6}
\end{table}

\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
