diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/stringenc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/stringenc.dtx | 198 |
1 files changed, 113 insertions, 85 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx b/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx index d39c7fafd83..fb8ea6bca77 100644 --- a/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx @@ -102,8 +102,8 @@ % TDS:tex/generic/oberdiek/se-cp1251.def % TDS:tex/generic/oberdiek/se-cp1257.def % TDS:doc/latex/oberdiek/stringenc.pdf -% TDS:doc/latex/oberdiek/stringenc-test1.tex -% TDS:doc/latex/oberdiek/stringenc-test2.tex +% TDS:doc/latex/oberdiek/test/stringenc-test1.tex +% TDS:doc/latex/oberdiek/test/stringenc-test2.tex % TDS:source/latex/oberdiek/stringenc.dtx % %<*ignore> @@ -119,7 +119,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: stringenc 2007/09/09 v1.2 Converts strings between encodings (HO)} +\Msg{* Package: stringenc 2007/10/22 v1.3 Converts strings between encodings (HO)} \Msg{************************************************************************} \keepsilent @@ -205,7 +205,7 @@ and the derived files \file{se-cp1250.def}{\from{stringenc.dtx}{general,cp1250}}% \file{se-cp1251.def}{\from{stringenc.dtx}{general,cp1251}}% \file{se-cp1257.def}{\from{stringenc.dtx}{general,cp1257}}% - \usedir{doc/latex/oberdiek}% + \usedir{doc/latex/oberdiek/test}% \file{stringenc-test1.tex}{\from{stringenc.dtx}{test1}}% \file{stringenc-test2.tex}{\from{stringenc.dtx}{test2}}% } @@ -244,9 +244,9 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{stringenc.drv}% - [2007/09/09 v1.2 Converts strings between encodings (HO)]% + [2007/10/22 v1.3 Converts strings between encodings (HO)]% \documentclass{ltxdoc} -\usepackage{holtxdoc} +\usepackage{holtxdoc}[2007/10/21] \usepackage{longtable} \begin{document} \DocInput{stringenc.dtx}% @@ -254,7 +254,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{5882} +% \CheckSum{5894} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -275,7 +275,7 @@ and the derived files % \GetFileInfo{stringenc.drv} % % \title{The \xpackage{stringenc} package} -% \date{2007/09/09 v1.2} +% \date{2007/10/22 v1.3} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -342,8 +342,9 @@ and the derived files % \begin{declcs}{StringEncodingConvertTest} % \M{cmd} \M{string} \M{from} \M{to} \M{success} \M{failure} % \end{declcs} -% If the converted string does not interest in case of an -% error, then \cs{StringEncodingConvertTest} is more efficient, +% Macro \cs{StringEncodingConvertTest} is more efficient +% than \cs{StringEncodingConvert} if the converted string +% does not interest in case of an error, % because the conversion stops at the first error. % If \meta{string} can be successfully converted from encoding % \meta{from} to encoding \meta{to}, then macro \meta{cmd} contains @@ -351,6 +352,11 @@ and the derived files % code \meta{failure} is executed, the contents of \meta{cmd} is % undefined. % +% \begin{declcs}{StringEncodingList} +% \end{declcs} +% Macro \cs{StringEncodingList} contains a comma separated +% list of supported encodings (without alias names). +% % \subsection{Supported encodings} % % \begin{longtable}{@{}ll@{}} @@ -461,7 +467,7 @@ and the derived files \fi \expandafter\x\csname ver@stringenc.sty\endcsname \ProvidesPackage{stringenc}% - [2007/09/09 v1.2 Converts strings between encodings (HO)] + [2007/10/22 v1.3 Converts strings between encodings (HO)] % \end{macrocode} % % \subsection{Catcodes} @@ -752,23 +758,15 @@ and the derived files \def\StringEncodingLoad#1{% \begingroup \catcode32=10 % space/space - \catcode34=12 % " \catcode35=6 % #/parameter \catcode37=14 % percent/comment character - \catcode45=12 % - - \catcode46=12 % . - \catcode47=12 % / - \catcode58=12 % : - \catcode60=12 % < - \catcode61=12 % = - \catcode62=12 % > - \catcode64=11 % @ - \catcode91=12 % [ \catcode92=0 % backslash/escape character - \catcode93=12 % ] \catcode123=1 % {/beginning of group \catcode125=2 % }/end of group \endlinechar=-1 % + \SE@MakeLetters @ABCDEFGHIKLMNOPRSTU% + abcdefghiklmnoprstuvwxyz\relax + \SE@MakeOthers "-./:<=>[]0123456789\relax \expandafter\ifx\csname ProvidesFile\endcsname\relax \def\ProvidesFile##1[##2]{% \immediate\write-1{File: ##1 ##2}% @@ -780,6 +778,29 @@ and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}{\SE@MakeLetters} +% \begin{macrocode} +\def\SE@MakeLetters#1{% + \ifx#1\relax + \else + \catcode`#1=11 % + \expandafter\SE@MakeLetters + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\SE@MakeOthers} +% \begin{macrocode} +\def\SE@MakeOthers#1{% + \ifx#1\relax + \else + \catcode`#1=12 % + \expandafter\SE@MakeOthers + \fi +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\SE@InputIfFileExists} % \begin{macrocode} \begingroup\expandafter\expandafter\expandafter\endgroup @@ -1342,9 +1363,9 @@ $ \fi \SE@temp{nextstep} % \end{macrocode} % -% \begin{macro}{\SE@EncodingFileList} +% \begin{macro}{\StringEncodingList} % \begin{macrocode} -\def\SE@EncodingFileList{% +\def\StringEncodingList{% ascii,% cp437,% cp850,% @@ -1397,8 +1418,8 @@ $ \fi % % \begin{macrocode} %<*utf32> -%<utf32be>\ProvidesFile{se-utf32be.def}[2007/09/09 v1.2 stringenc: UTF-32BE] -%<utf32le>\ProvidesFile{se-utf32le.def}[2007/09/09 v1.2 stringenc: UTF-32LE] +%<utf32be>\ProvidesFile{se-utf32be.def}[2007/10/22 v1.3 stringenc: UTF-32BE] +%<utf32le>\ProvidesFile{se-utf32le.def}[2007/10/22 v1.3 stringenc: UTF-32LE] % \end{macrocode} % % \begin{macrocode} @@ -1556,7 +1577,7 @@ $ \fi % % \begin{macrocode} %<*utf8> -\ProvidesFile{se-utf8.def}[2007/09/09 v1.2 stringenc: UTF-8] +\ProvidesFile{se-utf8.def}[2007/10/22 v1.3 stringenc: UTF-8] % \end{macrocode} % % \noindent @@ -1896,7 +1917,7 @@ $ \fi % % \begin{macrocode} %<*utf16le> -\ProvidesFile{se-utf16le.def}[2007/09/09 v1.2 stringenc: UTF-16LE] +\ProvidesFile{se-utf16le.def}[2007/10/22 v1.3 stringenc: UTF-16LE] % \end{macrocode} % % \begin{macrocode} @@ -1936,7 +1957,7 @@ $ \fi % % \begin{macrocode} %<*pdfdoc> -\ProvidesFile{se-pdfdoc.def}[2007/09/09 v1.2 stringenc: PDFDocEncoding] +\ProvidesFile{se-pdfdoc.def}[2007/10/22 v1.3 stringenc: PDFDocEncoding] % \end{macrocode} % % Pass ranges 32..126 and 160..255 through and use @@ -2067,7 +2088,7 @@ $ \fi % % \begin{macrocode} %<*iso-8859-1> -\ProvidesFile{se-iso-8859-1.def}[2007/09/09 v1.2 stringenc: ISO-8859-1] +\ProvidesFile{se-iso-8859-1.def}[2007/10/22 v1.3 stringenc: ISO-8859-1] % \end{macrocode} % % Excluded area: 0x80..0x9F @@ -2137,7 +2158,7 @@ $ \fi % % \begin{macrocode} %<*cp1252> -\ProvidesFile{se-cp1252.def}[2007/09/09 v1.2 stringenc: cp1252] +\ProvidesFile{se-cp1252.def}[2007/10/22 v1.3 stringenc: cp1252] % \end{macrocode} % % \begin{macrocode} @@ -2238,7 +2259,7 @@ $ \fi % % \begin{macrocode} %<*ascii> -\ProvidesFile{se-ascii.def}[2007/09/09 v1.2 stringenc: US-ASCII] +\ProvidesFile{se-ascii.def}[2007/10/22 v1.3 stringenc: US-ASCII] % \end{macrocode} % % \begin{macrocode} @@ -2287,123 +2308,123 @@ $ \fi % % \begin{macrocode} %<*iso-8859-2> -\ProvidesFile{se-iso-8859-2.def}[2007/09/09 v1.2 stringenc: ISO-8859-2] +\ProvidesFile{se-iso-8859-2.def}[2007/10/22 v1.3 stringenc: ISO-8859-2] \def\SE@this{iso-8859-2} %</iso-8859-2> %<*iso-8859-3> -\ProvidesFile{se-iso-8859-3.def}[2007/09/09 v1.2 stringenc: ISO-8859-3] +\ProvidesFile{se-iso-8859-3.def}[2007/10/22 v1.3 stringenc: ISO-8859-3] \def\SE@this{iso-8859-3} %</iso-8859-3> %<*iso-8859-4> -\ProvidesFile{se-iso-8859-4.def}[2007/09/09 v1.2 stringenc: ISO-8859-4] +\ProvidesFile{se-iso-8859-4.def}[2007/10/22 v1.3 stringenc: ISO-8859-4] \def\SE@this{iso-8859-4} %</iso-8859-4> %<*iso-8859-5> -\ProvidesFile{se-iso-8859-5.def}[2007/09/09 v1.2 stringenc: ISO-8859-5] +\ProvidesFile{se-iso-8859-5.def}[2007/10/22 v1.3 stringenc: ISO-8859-5] \def\SE@this{iso-8859-5} %</iso-8859-5> %<*iso-8859-6> -\ProvidesFile{se-iso-8859-6.def}[2007/09/09 v1.2 stringenc: ISO-8859-6] +\ProvidesFile{se-iso-8859-6.def}[2007/10/22 v1.3 stringenc: ISO-8859-6] \def\SE@this{iso-8859-6} %</iso-8859-6> %<*iso-8859-7> -\ProvidesFile{se-iso-8859-7.def}[2007/09/09 v1.2 stringenc: ISO-8859-7] +\ProvidesFile{se-iso-8859-7.def}[2007/10/22 v1.3 stringenc: ISO-8859-7] \def\SE@this{iso-8859-7} %</iso-8859-7> %<*iso-8859-8> -\ProvidesFile{se-iso-8859-8.def}[2007/09/09 v1.2 stringenc: ISO-8859-8] +\ProvidesFile{se-iso-8859-8.def}[2007/10/22 v1.3 stringenc: ISO-8859-8] \def\SE@this{iso-8859-8} %</iso-8859-8> %<*iso-8859-9> -\ProvidesFile{se-iso-8859-9.def}[2007/09/09 v1.2 stringenc: ISO-8859-9] +\ProvidesFile{se-iso-8859-9.def}[2007/10/22 v1.3 stringenc: ISO-8859-9] \def\SE@this{iso-8859-9} %</iso-8859-9> %<*iso-8859-10> -\ProvidesFile{se-iso-8859-10.def}[2007/09/09 v1.2 stringenc: ISO-8859-10] +\ProvidesFile{se-iso-8859-10.def}[2007/10/22 v1.3 stringenc: ISO-8859-10] \def\SE@this{iso-8859-10} %</iso-8859-10> %<*iso-8859-11> -\ProvidesFile{se-iso-8859-11.def}[2007/09/09 v1.2 stringenc: ISO-8859-11] +\ProvidesFile{se-iso-8859-11.def}[2007/10/22 v1.3 stringenc: ISO-8859-11] \def\SE@this{iso-8859-11} %</iso-8859-11> %<*iso-8859-13> -\ProvidesFile{se-iso-8859-13.def}[2007/09/09 v1.2 stringenc: ISO-8859-13] +\ProvidesFile{se-iso-8859-13.def}[2007/10/22 v1.3 stringenc: ISO-8859-13] \def\SE@this{iso-8859-13} %</iso-8859-13> %<*iso-8859-14> -\ProvidesFile{se-iso-8859-14.def}[2007/09/09 v1.2 stringenc: ISO-8859-14] +\ProvidesFile{se-iso-8859-14.def}[2007/10/22 v1.3 stringenc: ISO-8859-14] \def\SE@this{iso-8859-14} %</iso-8859-14> %<*iso-8859-15> -\ProvidesFile{se-iso-8859-15.def}[2007/09/09 v1.2 stringenc: ISO-8859-15] +\ProvidesFile{se-iso-8859-15.def}[2007/10/22 v1.3 stringenc: ISO-8859-15] \def\SE@this{iso-8859-15} %</iso-8859-15> %<*iso-8859-16> -\ProvidesFile{se-iso-8859-16.def}[2007/09/09 v1.2 stringenc: ISO-8859-16] +\ProvidesFile{se-iso-8859-16.def}[2007/10/22 v1.3 stringenc: ISO-8859-16] \def\SE@this{iso-8859-16} %</iso-8859-16> %<*koi8-r> -\ProvidesFile{se-koi8-r.def}[2007/09/09 v1.2 stringenc: KOI8-R] +\ProvidesFile{se-koi8-r.def}[2007/10/22 v1.3 stringenc: KOI8-R] \def\SE@this{koi8-r} %</koi8-r> %<*nextstep> -\ProvidesFile{se-nextstep.def}[2007/09/09 v1.2 stringenc: NextStep] +\ProvidesFile{se-nextstep.def}[2007/10/22 v1.3 stringenc: NextStep] \def\SE@this{nextstep} %</nextstep> %<*mac-centeuro> -\ProvidesFile{se-mac-centeuro.def}[2007/09/09 v1.2 stringenc: Mac OS Central European] +\ProvidesFile{se-mac-centeuro.def}[2007/10/22 v1.3 stringenc: Mac OS Central European] \def\SE@this{mac-centeuro} %</mac-centeuro> %<*mac-cyrillic> -\ProvidesFile{se-mac-cyrillic.def}[2007/09/09 v1.2 stringenc: Mac OS Cyrillic] +\ProvidesFile{se-mac-cyrillic.def}[2007/10/22 v1.3 stringenc: Mac OS Cyrillic] \def\SE@this{mac-cyrillic} %</mac-cyrillic> %<*mac-roman> -\ProvidesFile{se-mac-roman.def}[2007/09/09 v1.2 stringenc: Mac OS Roman] +\ProvidesFile{se-mac-roman.def}[2007/10/22 v1.3 stringenc: Mac OS Roman] \def\SE@this{mac-roman} %</mac-roman> %<*dec-mcs> -\ProvidesFile{se-dec-mcs.def}[2007/09/09 v1.2 stringenc: DEC-MCS] +\ProvidesFile{se-dec-mcs.def}[2007/10/22 v1.3 stringenc: DEC-MCS] \def\SE@this{dec-mcs} %</dec-mcs> %<*cp437> -\ProvidesFile{se-cp437.def}[2007/09/09 v1.2 stringenc: cp437] +\ProvidesFile{se-cp437.def}[2007/10/22 v1.3 stringenc: cp437] \def\SE@this{cp437} %</cp437> %<*cp850> -\ProvidesFile{se-cp850.def}[2007/09/09 v1.2 stringenc: cp850] +\ProvidesFile{se-cp850.def}[2007/10/22 v1.3 stringenc: cp850] \def\SE@this{cp850} %</cp850> %<*cp852> -\ProvidesFile{se-cp852.def}[2007/09/09 v1.2 stringenc: cp852] +\ProvidesFile{se-cp852.def}[2007/10/22 v1.3 stringenc: cp852] \def\SE@this{cp852} %</cp852> %<*cp855> -\ProvidesFile{se-cp855.def}[2007/09/09 v1.2 stringenc: cp855] +\ProvidesFile{se-cp855.def}[2007/10/22 v1.3 stringenc: cp855] \def\SE@this{cp855} %</cp855> %<*cp858> -\ProvidesFile{se-cp858.def}[2007/09/09 v1.2 stringenc: cp858] +\ProvidesFile{se-cp858.def}[2007/10/22 v1.3 stringenc: cp858] \def\SE@this{cp858} %</cp858> %<*cp865> -\ProvidesFile{se-cp865.def}[2007/09/09 v1.2 stringenc: cp865] +\ProvidesFile{se-cp865.def}[2007/10/22 v1.3 stringenc: cp865] \def\SE@this{cp865} %</cp865> %<*cp866> -\ProvidesFile{se-cp866.def}[2007/09/09 v1.2 stringenc: cp866] +\ProvidesFile{se-cp866.def}[2007/10/22 v1.3 stringenc: cp866] \def\SE@this{cp866} %</cp866> %<*cp1250> -\ProvidesFile{se-cp1250.def}[2007/09/09 v1.2 stringenc: cp1250] +\ProvidesFile{se-cp1250.def}[2007/10/22 v1.3 stringenc: cp1250] \def\SE@this{cp1250} %</cp1250> %<*cp1251> -\ProvidesFile{se-cp1251.def}[2007/09/09 v1.2 stringenc: cp1251] +\ProvidesFile{se-cp1251.def}[2007/10/22 v1.3 stringenc: cp1251] \def\SE@this{cp1251} %</cp1251> %<*cp1257> -\ProvidesFile{se-cp1257.def}[2007/09/09 v1.2 stringenc: cp1257] +\ProvidesFile{se-cp1257.def}[2007/10/22 v1.3 stringenc: cp1257] \def\SE@this{cp1257} %</cp1257> % \end{macrocode} @@ -5877,10 +5898,10 @@ $ \fi \repeat } \def\Test{% - \RangeCatcodeInvalid{0}{47} - \RangeCatcodeInvalid{58}{64} - \RangeCatcodeInvalid{91}{96} - \RangeCatcodeInvalid{123}{255} + \RangeCatcodeInvalid{0}{47}% + \RangeCatcodeInvalid{58}{64}% + \RangeCatcodeInvalid{91}{96}% + \RangeCatcodeInvalid{123}{255}% \catcode`\@=12 % \catcode`\\=0 % \catcode`\{=1 % @@ -5891,7 +5912,7 @@ $ \fi \catcode`\%=14 % \catcode`\ =10 % \catcode13=5 % - \usepackage{stringenc}[2007/09/09]% + \usepackage{stringenc}[2007/10/22]% \RestoreCatcodes } \Test @@ -5904,22 +5925,23 @@ $ \fi \IncludeTests{*} \LogTests{log}{*}{*} \def\Test#1{% - \begin{qstest}{loading}{loading} - \RangeCatcodeInvalid{0}{47}% - % 0-9 - \RangeCatcodeInvalid{58}{64}% - % A-Z - \RangeCatcodeInvalid{91}{96}% - % a-z - \RangeCatcodeInvalid{123}{255}% + \begin{qstest}{loading}{loading}% +% \RangeCatcodeInvalid{0}{47}% +% % 0-9 +% \RangeCatcodeInvalid{58}{64}% +% % A-Z +% \RangeCatcodeInvalid{91}{96}% +% % a-z +% \RangeCatcodeInvalid{123}{255}% \setbox0=\hbox{% \def\par{p}% + \RangeCatcodeInvalid{0}{255}% \StringEncodingLoad{#1}% }% - \Expect*{\the\wd0}{0.0pt} - \end{qstest} + \Expect*{\the\wd0}{0.0pt}% + \end{qstest}% } -\@for\x:=\SE@EncodingFileList\do{% +\@for\x:=\StringEncodingList\do{% \Test\x } \@@end @@ -5941,7 +5963,7 @@ $ \fi \let\SavedNumexpr\numexpr \let\numexpr\relax \fi -\usepackage{stringenc}[2007/09/09] +\usepackage{stringenc}[2007/10/22] \ifx\plainmode Y \let\numexpr\SavedNumexpr \fi @@ -5957,7 +5979,7 @@ $ \fi \x } \def\TestTest#1#2#3#4#5|#6|#7\NIL{% - \begin{qstest}{encodings}{encodings, conversion} + \begin{qstest}{encodings}{encodings, conversion}% \setbox0=\hbox{% \def\par{p}% \EdefUnescapeHex\IN{#4}% @@ -5973,8 +5995,8 @@ $ \fi }% }% }% - \Expect*{\the\wd0}{0.0pt} - \end{qstest} + \Expect*{\the\wd0}{0.0pt}% + \end{qstest}% } \def\AllBytesLow{% @@ -6403,8 +6425,8 @@ $ \fi % se-cp1251.def & tex/generic/oberdiek/se-cp1251.def\\ % se-cp1257.def & tex/generic/oberdiek/se-cp1257.def\\ % stringenc.pdf & doc/latex/oberdiek/stringenc.pdf\\ -% stringenc-test1.tex & doc/latex/oberdiek/stringenc-test1.tex\\ -% stringenc-test2.tex & doc/latex/oberdiek/stringenc-test2.tex\\ +% test/stringenc-test1.tex & doc/latex/oberdiek/test/stringenc-test1.tex\\ +% test/stringenc-test2.tex & doc/latex/oberdiek/test/stringenc-test2.tex\\ % stringenc.dtx & source/latex/oberdiek/stringenc.dtx\\ % \end{tabular}^^A % }^^A @@ -6536,11 +6558,17 @@ $ \fi % \item % Fixes for cp850, cp852, nextstep. % \end{Version} -% \begin{Version}{2007/08/27 v1.2} +% \begin{Version}{2007/09/09 v1.2} % \item % Uses \cs{EdefSanitize} instead of \cs{PE@sanitize} % from package \xpackage{pdfescape} (2007/08/27 v1.5). % \end{Version} +% \begin{Version}{2007/10/22 v1.3} +% \item +% \cs{StringEncodingList} added. +% \item +% Safer encoding file loading by ensuring all used catcodes. +% \end{Version} % \end{History} % % \PrintIndex |