From 24693245efbc469d763e5e52a088f488f71f6e35 Mon Sep 17 00:00:00 2001 From: mirabilos <m@mirbsd.org> Date: Tue, 12 Nov 2019 19:43:47 +0100 Subject: [PATCH] use consistent (comment) styles: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Teχ style for hex ("00) • Pascal style in WTF-8 for ranges (a‥b) • UCS vs. UTF-8 --- unicodedomino_kernel_better_decode.def | 26 +++++++++++++------------- unicodedomino_kernel_cosmetics.def | 2 +- unicodedomino_kernel_fixup_f4.def | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/unicodedomino_kernel_better_decode.def b/unicodedomino_kernel_better_decode.def index fb52a22..b8a132f 100644 --- a/unicodedomino_kernel_better_decode.def +++ b/unicodedomino_kernel_better_decode.def @@ -4,9 +4,9 @@ % this file is dual-licenced under the LPPL version 1.3c or later. %- % Fix check for illegal sequences to fail overlong encoded sequences -% as well as codepoints outside of the Unicode range [0;10FFFF]. Use -% fixed-up check code to improve Unicode decoding. This is the enti†-% rety of PR https://github.com/latex3/latex2e/pull/83 (rejected). +% as well as codepoints outside of the UCS range [0;10FFFF]; improve +% UTF-8 decoding with fixed-up check code and a safer UTF-8 decoder. +% This is https://github.com/latex3/latex2e/pull/83 (rejected). % new check for illegal sequences \gdef\UTFviii@checkseq#1:#2#3\empty{% @@ -20,27 +20,27 @@ 1% \else% \ifnum`#2<"E0 % - % one 80-BF + % one "80‥"BF \UTFviii@check@one#3\empty% \else% \ifnum`#2<"E1 % - % A0-BF + one 80-BF + % "A0‥"BF + one "80‥"BF \UTFviii@check@two"A0.#3\empty% \else% \ifnum`#2<"F0 % - % two 80-BF + % two "80‥"BF \UTFviii@check@two"80.#3\empty% \else% \ifnum`#2<"F1 % - % 90-BF + two 80-BF + % "90‥"BF + two "80‥"BF \UTFviii@check@three"90."BF.#3\empty% \else% \ifnum`#2<"F4 % - % three 80-BF + % three "80‥"BF \UTFviii@check@three"80."BF.#3\empty% \else% \ifnum`#2<"F5 % - % 80-8F + two 80-BF + % "80‥"8F + two "80‥"BF \UTFviii@check@three"80."8F.#3\empty% \else% 1% @@ -54,7 +54,7 @@ \fi% }% -% check last trail octet in the range "80.."BF +% check last trail octet in the range "80‥"BF \gdef\UTFviii@check@one#1#2\empty{% \ifx\empty#2\empty% \ifnum`#1<"80 % @@ -69,7 +69,7 @@ \fi% }% -% check second-to-last trail octet in the range #1.."BF +% check second-to-last trail octet in the range #1‥"BF \gdef\UTFviii@check@two#1.#2#3\empty{% \ifx\empty#3\empty% 1% @@ -86,7 +86,7 @@ \fi% }% -% check third-to-last trail octet in the range #1..#2 +% check third-to-last trail octet in the range #1‥#2 \gdef\UTFviii@check@three#1.#2.#3#4\empty{% \ifx\empty#4\empty% 1% @@ -135,7 +135,7 @@ % decode lead octet \gdef\UTFviii@dec@lead#1:#2#3\relax{% - % we know #2 is in 00..7F, C2..F4 + % we know #2 is in "00‥"7F, "C2‥"F4 \ifnum`#2<"80 % `#2% \else% diff --git a/unicodedomino_kernel_cosmetics.def b/unicodedomino_kernel_cosmetics.def index ee2a96f..41a9e6d 100644 --- a/unicodedomino_kernel_cosmetics.def +++ b/unicodedomino_kernel_cosmetics.def @@ -14,7 +14,7 @@ }% \fi% -% override to format a hex Unicode codepoint correctly +% override to format a UCS codepoint (hexadecimal notation) correctly \gdef\UTFviii@hexcodepoint#1{% \ifnum#1<16 U+000% \else\ifnum#1<256 U+00% diff --git a/unicodedomino_kernel_fixup_f4.def b/unicodedomino_kernel_fixup_f4.def index 3d90add..afad014 100644 --- a/unicodedomino_kernel_fixup_f4.def +++ b/unicodedomino_kernel_fixup_f4.def @@ -3,15 +3,15 @@ % See unicodedomino.sty for copyright and licence terms. Furthermore % this file is dual-licenced under the LPPL version 1.3c or later. %- -% Disallow codepoints outside of the Unicode range [0;10FFFF]; allow -% "F4 as lead octet. Fixed upstream v1.2e 2018/09/28 +% Disallow codepoints outside of the UCS range [0;10FFFF]; allow "F4 +% as lead octet. Fixed upstream v1.2e 2018/09/28 % bugfix: disallow too large definitions \let\unicodedomino@parse@XML@charref\parse@XML@charref% \gdef\parse@XML@charref{% \ifnum\count@>"10FFFF\relax% \PackageError{inputenc}{% - Cannot define Unicode char value\space% + Cannot define UCS codepoint\space% \UTFviii@hexnumber\count@\space% (too large)% }% -- GitLab