summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/bxbase/bxutf8x.def')
-rw-r--r--Master/texmf-dist/tex/latex/bxbase/bxutf8x.def64
1 files changed, 40 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def b/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
index a703d5bfe94..972f392fd94 100644
--- a/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
+++ b/Master/texmf-dist/tex/latex/bxbase/bxutf8x.def
@@ -1,40 +1,54 @@
+%%
+%% This is file 'bxutf8x.def'.
+%%
%
-% bxutf8x.def
-%
-%%%% package declarations
-\ProvidesFile{bxutf8x.def}[2008/04/06 v0.3
- BX UTF-8 input encoding (ucs ver.)]
+%% file declaration
+\ProvidesFile{bxutf8x.def}[2017/05/29 v1.1 BX extended utf8x input]
%
% Note: All definitions in this file should be local.
+% This file should not spill any spaces or \par.
%
-%%%% preparation
+%% code guards
\catcode32=10\relax
-\expandafter\edef\csname bx@b@resetcatcodes\endcsname{% " . : @
- \catcode34=\the\catcode34\catcode46=\the\catcode46%
- \catcode58=\the\catcode39\catcode64=\the\catcode64\relax}%
-\catcode34=12 \catcode46=12 \catcode58=12 \catcode64=11 %
+\expandafter\edef\csname bxus@i@restore@codes\endcsname{%
+ \catcode34=\the\catcode34% <">
+ \catcode46=\the\catcode46% <.>
+ \catcode58=\the\catcode58% <:>
+ \catcode64=\the\catcode64% <@>
+\relax}%
+\catcode34=12 %
+\catcode46=12 %
+\catcode58=12 %
+\catcode64=11 %
+\g@addto@macro\bxus@i@restore@codes{%
+ \let\bxus@i@restore@codes\@undefined}%
+%
+%--------------------------------------- dynamic part
+%
\def\bxus@i@error{\PackageError{inputenc}}%
\ifx\@nodocument\relax
\ifx\bxus@bxutfx@loaded\@undefined
- \bxus@i@error{cannot load `bxutf8x' after \string\begin{document}}%
- \@eha \bx@b@resetcatcodes\endinput\fi\fi
+ \bxus@i@error
+ {cannot load `bxutf8x' after \string\begin{document}}\@eha
+ \bxus@i@restore@codes\endinput\fi\fi
%
-%%%% load 'utf8x' encoding
+%% load 'utf8x' encoding
\InputIfFileExists{utf8x.def}{}%
{\PackageError{inputenc}{input encoding `utf8x' unavailable}%
{You must install `unicode' package to use it.}%
- \bx@b@resetcatcodes\endinput}%
+ \bxus@i@restore@codes\endinput}%
%\@inpenc@test % This is done in utf8.def
%
% When this file is reloaded, the 'static' part will be skipped.
\ifx\bxus@bxutfx@loaded\@undefined\else
- \bx@b@resetcatcodes \endinput \fi
+ \bxus@i@restore@codes \endinput \fi
\let\bxus@bxutfx@loaded=t%
%
-%%---------- Beginning of static part
+%--------------------------------------- Static part
%
-%%%% error messages
-\def\bxus@err@nodrv{\bxus@i@error{Unicode driver not found}\@ehb}%
+%% error messages
+\def\bxus@err@nodrv{\bxus@i@error
+ {Unicode driver not found}\@ehb}%
%
%%%% \bxus@uc@char@notloaded
% Hooked version of \uc@char@notloaded
@@ -58,23 +72,25 @@
\def\bxus@uc@notloaderr#1#2#3{%
\bxUInt{#1}}% \bxUInt should be robust
%
-%%%% attach the hook
+%% attach the hook
% Note that ucs.sty could be loaded after utf8x.def.
\AtBeginDocument{%
\let\uc@notloaderr\bxus@uc@notloaderr
\let\uc@char@notloaded\bxus@uc@char@notloaded}%
%
-%%%% force ucs 'fasterrors' option switched on
+%% force ucs 'fasterrors' option switched on
% Heavy 'uninames' decoding process is of no use in presence of the hook,
% and it causes unexpected result in use of pTeX.
\AtBeginDocument{%
\let\UnicodeOptionfasterrorsfalse\UnicodeOptionfasterrorstrue
\UnicodeOptionfasterrorstrue}%
%
-%%%% default (useless) Unicode driver
-\providecommand*\bxUInt[1]{?\protect\bxus@err@nodrv}%
+%% default (useless) Unicode driver
+% Note: this \bxUHex definition is used for check.
+\providecommand*\bxUInt{\bxUIntDummyBxutfx}%
+\newcommand*\bxUIntDummyBxutfx[1]{?\protect\bxus@err@nodrv}%
%
-%%%% all done
-\bx@b@resetcatcodes
+%--------------------------------------- all done
+\bxus@i@restore@codes
\endinput
%% EOF