# -*-coding: utf-8; tab-width: 8;-*-

# Control characters

CTRLGLYPH

{
PROVIDE MULTILINE
\gdef\uc@pdfstack{}%
\gdef\uc@rlengine{%
  \ifx\beginL\undefined
    \PackageError{ucs}{Need right-to-left
      engine}{Please use e.g. elatex instead of latex}%
    \let\beginL\relax\let\beginR\relax
    \let\endL\relax\let\endR\relax\else
    \ifnum\TeXXeTstate=0
      \PackageWarning{ucs}{Setting \protect\TeXXeTstate=1}%
      \TeXXeTstate=1\fi\fi
  \let\uc@pdfstack\empty
  \let\uc@rlengine\empty}%
\gdef\uc@pdf@#1#2\@nil{%
  #1\def\uc@pdfstack{#2}}%
\gdef\uc@pdferror{\PackageError{ucs}{PDF occurred without matching
    LRO/RLO}{Nest LRO/RLO and PDF properly with respect to
    TeX-groups}}%
END

U+202C  \ifx\uc@pdfstack\empty\uc@pdferror\else\expandafter\uc@pdf@\uc@pdfstack\@nil\fi      # [‬]
U+202D  \uc@rlengine\beginL\edef\uc@pdfstack{\endL\uc@pdfstack} # [‭]
U+202E  \uc@rlengine\beginR\edef\uc@pdfstack{\endR\uc@pdfstack} # [‮]
}

{
PROVIDE MULTILINE
\gdef\uc@lrmark{%
  \PackageWarning{ucs}{This text contains LRM/RLM/LRE/RLE
    characters.\MessageBreak Note that these are ignored because of
    incomplete\MessageBreak right-to-left capability. Try using
    LRO/RLO/PDF\MessageBreak characters instead to ensure correct
    order.\MessageBreak}%
  \gdef\uc@lrmark{}}%
END

U+200E  \uc@lrmark      # [‎]
U+200F  \uc@lrmark      # [‏]
U+202A  \uc@lrmark      # [‪]
U+202B  \uc@lrmark      # [‫]
}

{
U+2028  \leavevmode\newline	# [ ]
U+0020	\space			# [ ]
U+FEFF	{}
U+2000	\enskip			# [ ]
U+2001	\quad			# [ ]
U+2002	\enskip			# [ ]
U+2003	\quad			# [ ]
U+2004	\kern.33333em\uc@spc	# [ ]
U+2005	\kern.25em\uc@spc	# [ ]
U+2006	\kern.16667em\uc@spc	# [ ]
U+2009	\thinspace		# [ ]
U+200B	\hskip\z@\relax		# [​]
U+200C	{}			# [‌]
U+200D	<empty>			# [‍]
}

{
PACKAGE amsmath

U+2011	\nobreakdash-           # [‑]
}

{
PROVIDE		\long\gdef\uc@par{\par}
U+2029  \uc@par            # [ ]
}

{
U+FFFE	\PackageError{ucs}{U+FFFE occured.}{Probably some byte order problem occured during some conversion step.}
U+FFFF	\PackageError{ucs}{U+FFFF occured.}{This is no Unicode character.}
}
