summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/t2/etc/utf-8/utf-8.def
blob: 329b947e2a01391c614c69340aa2381d75b1ab4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Copyright 2000 Vladimir Volovich <vvv@vsu.ru>
\ProvidesFile{utf-8.def}[2000/08/19 v0.1 input encoding file for utf-8]

\makeatletter
\let\@inpenc@test\relax

\count@192
\loop
  \bgroup
    \uccode`\~\count@
    \uppercase{%
  \egroup
    \def~##1{\csname U2\string~\string##1\endcsname}%
    }
\ifnum\count@<223\relax
  \advance\count@\@ne
\repeat

\count@224
\loop
  \bgroup
    \uccode`\~\count@
    \uppercase{%
  \egroup
    \def~##1##2{\csname U3\string~\string##1\string##2\endcsname}%
    }
\ifnum\count@<239\relax
  \advance\count@\@ne
\repeat

% FIXME: define U4, U5, U6

\def\get@code#1#2;{\count@\if x\noexpand#1"\else#1\fi#2\relax}

\def\UnicodeCharacter#1#2{%
  \get@code#1;%
  \ifnum\count@<"80\relax
    \Error
  \else\ifnum\count@<"800\relax
    \@tempcnta\count@
    \divide\count@64
    \bgroup
      \advance\count@192
      \uccode`\~\count@
      \uppercase{%
    \egroup
      \toks@{U2\string~}%
      }%
    \multiply\count@64
    \advance\@tempcnta-\count@
    \advance\@tempcnta"80
    \bgroup
      \uccode`\~\@tempcnta
      \uppercase{%
    \egroup
      \toks@\expandafter{\the\toks@\string~}%
      }%
    \expandafter\expandafter\expandafter
    \def\expandafter\csname\the\toks@\endcsname{#2}%
  \else
    \Error
  \fi\fi
}

\@ifundefined{ver@utfcyr.def}{\input{utfcyr.def}}\relax
\@ifundefined{ver@utflat.def}{\input{utflat.def}}\relax

\makeatother