diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/stringenc.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/stringenc.dtx | 324 |
1 files changed, 235 insertions, 89 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx b/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx index a9d605d362b..530078f87c9 100644 --- a/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/stringenc.dtx @@ -119,7 +119,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: stringenc 2007/06/14 v1.0 Converts strings between encodings (HO)} +\Msg{* Package: stringenc 2007/06/16 v1.1 Converts strings between encodings (HO)} \Msg{************************************************************************} \keepsilent @@ -244,7 +244,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{stringenc.drv}% - [2007/06/14 v1.0 Converts strings between encodings (HO)]% + [2007/06/16 v1.1 Converts strings between encodings (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc} \usepackage{longtable} @@ -254,7 +254,7 @@ and the derived files %</driver> % \fi % -% \CheckSum{5689} +% \CheckSum{5880} % % \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/06/14 v1.0} +% \date{2007/06/16 v1.1} % \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} % % \maketitle @@ -339,6 +339,18 @@ and the derived files %\end{verbatim} %\end{quote} % +% \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, +% 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 +% the result and code \meta{success} is executed. Otherwise +% code \meta{failure} is executed, the contents of \meta{cmd} is +% undefined. +% % \subsection{Supported encodings} % % \begin{longtable}{@{}ll@{}} @@ -449,7 +461,7 @@ and the derived files \fi \expandafter\x\csname ver@stringenc.sty\endcsname \ProvidesPackage{stringenc}% - [2007/06/14 v1.0 Converts strings between encodings (HO)] + [2007/06/16 v1.1 Converts strings between encodings (HO)] % \end{macrocode} % % \subsection{Catcodes} @@ -649,12 +661,22 @@ and the derived files \fi \fi \fi + \ifSE@TestMode + \ifSE@invalid + \let\SE@next\SE@SkipRemaining + \fi + \fi \fi \fi \SE@next } % \end{macrocode} % \end{macro} +% \begin{macro}{\SE@SkipRemaining} +% \begin{macrocode} +\def\SE@SkipRemaining#1\relax{} +% \end{macrocode} +% \end{macro} % \begin{macro}{\SE@@ScanLow} % \begin{macrocode} \def\SE@@ScanLow#1#2#3#4{% @@ -672,15 +694,22 @@ and the derived files \fi \fi \SE@InvalidCharacter - \def\SE@next{% - SE@@ConvertTo#1#2#3#4% - }% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{SE@@ConvertTo#1#2#3#4}% + \fi \else \ifx\SE@ConvertSurrogate\relax \else \expandafter\SE@ConvertSurrogate\SE@high#1#2#3#4% \fi \let\SE@next\SE@@ConvertTo + \ifSE@TestMode + \ifSE@invalid + \let\SE@next\SE@SkipRemaining + \fi + \fi \fi \fi \SE@next @@ -996,10 +1025,16 @@ $ \ifcsname SE->#1@#2\endcsname $ \SE@ResultAdd{\csname SE->#1@#2\endcsname}% $ \else $ \SE@InvalidCharacter +$ \ifSE@TestMode +$ \let\SE@next\SE@SkipRemaining +$ \fi $ \fi & \begingroup\expandafter\expandafter\expandafter\endgroup & \expandafter\ifx\csname SE->#1@#2\endcsname\relax & \SE@InvalidCharacter +& \ifSE@TestMode +& \let\SE@next\SE@SkipRemaining +& \fi & \else & \SE@ResultAdd{\csname SE->#1@#2\endcsname}% & \fi @@ -1097,6 +1132,17 @@ $ \fi } % \end{macrocode} % \end{macro} +% \begin{macro}{\StringEncodingConvertTest} +% \begin{macrocode} +\def\StringEncodingConvertTest#1#2#3#4{% + \SE@TestModetrue + \StringEncodingConvert{#1}{#2}{#3}{#4}% + \SE@TestModefalse + \StringEncodingSuccessFailure +} +\newif\ifSE@TestMode +% \end{macrocode} +% \end{macro} % \begin{macro}{\SE@utfxvi} % \begin{macrocode} \PE@sanitize\SE@utfxvi{utf16} @@ -1292,7 +1338,7 @@ $ \fi \SE@temp{mac-centeuro} \SE@temp{mac-cyrillic} \SE@temp{mac-roman} -\SE@temp{mac-nextstep} +\SE@temp{nextstep} % \end{macrocode} % % \begin{macro}{\SE@EncodingFileList} @@ -1350,8 +1396,8 @@ $ \fi % % \begin{macrocode} %<*utf32> -%<utf32be>\ProvidesFile{se-utf32be.def}[2007/06/14 v1.0 stringenc: UTF-32BE] -%<utf32le>\ProvidesFile{se-utf32le.def}[2007/06/14 v1.0 stringenc: UTF-32LE] +%<utf32be>\ProvidesFile{se-utf32be.def}[2007/06/16 v1.1 stringenc: UTF-32BE] +%<utf32le>\ProvidesFile{se-utf32le.def}[2007/06/16 v1.1 stringenc: UTF-32LE] % \end{macrocode} % % \begin{macrocode} @@ -1420,14 +1466,17 @@ $ \fi } \gdef\SE@utfxxxii@be@from#1#2#3#4#5#6#7#8{% \ifx#1\relax + \let\SE@next\relax \else \ifx#8\relax + \let\SE@next\relax \SE@InvalidCharacter \else + \let\SE@next\SE@utfxxxii@be@from \SE@utfxxxii@from#1#2#3#4#5#6#7#8% - \expandafter\expandafter\expandafter\SE@utfxxxii@be@from \fi \fi + \SE@next } %</utf32be> %<*utf32le> @@ -1437,14 +1486,17 @@ $ \fi } \gdef\SE@utfxxxii@le@from#1#2#3#4#5#6#7#8{% \ifx#1\relax + \let\SE@next\relax \else \ifx#8\relax + \let\SE@next\relax \SE@InvalidCharacter \else + \let\SE@next\SE@utfxxxii@le@from \SE@utfxxxii@from#7#8#5#6#3#4#1#2% - \expandafter\expandafter\expandafter\SE@utfxxxii@le@from \fi \fi + \SE@next } %</utf32le> % \end{macrocode} @@ -1468,6 +1520,9 @@ $ \fi \fi \fi \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \ifcase"#3#4 % \SE@ResultAdd{#5#6#7#8}% @@ -1500,7 +1555,7 @@ $ \fi % % \begin{macrocode} %<*utf8> -\ProvidesFile{se-utf8.def}[2007/06/14 v1.0 stringenc: UTF-8] +\ProvidesFile{se-utf8.def}[2007/06/16 v1.1 stringenc: UTF-8] % \end{macrocode} % % \noindent @@ -1601,15 +1656,27 @@ $ \fi % \begin{macrocode} \expandafter\gdef\csname\SE@PrefixFrom utf8\endcsname#1{% \let\SE@temp\SE@Empty + \let\SE@next\SE@utfviii@filter \expandafter\SE@utfviii@filter#1\relax\relax - \expandafter\SE@utfviii@from\SE@temp\relax\relax\relax\relax - \relax\relax\relax\relax + \ifcase\ifSE@TestMode + \ifSE@invalid + \SE@one + \else + \SE@zero + \fi + \else + \SE@zero + \fi + \expandafter\SE@utfviii@from\SE@temp\relax\relax\relax\relax + \relax\relax\relax\relax + \fi } % \end{macrocode} % Invalid bytes in UTF-8: C0-C1, F5-FF % \begin{macrocode} \gdef\SE@utfviii@filter#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifcase\ifnum"#1#2>"F4 % \SE@zero @@ -1625,11 +1692,14 @@ $ \fi \fi \fi \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \edef\SE@temp{\SE@temp#1#2}% \fi - \expandafter\SE@utfviii@filter \fi + \SE@next } \gdef\SE@utfviii@from#1#2#3#4#5#6#7#8{% \ifx#1\relax @@ -1641,7 +1711,11 @@ $ \fi \else \ifnum"#1<12 % 10xx xxxx \SE@InvalidCharacter - \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}% + \fi \else \ifx#3\relax \let\SE@next\relax @@ -1649,7 +1723,11 @@ $ \fi \else \ifcase\SE@utfviii@CheckCont#3% \SE@InvalidCharacter - \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{\SE@utfviii@from#3#4#5#6#7#8}% + \fi \else \ifnum"#1<14 % 110y yyyy 10xx xxxx % 0000 0yyy yyxx xxxx @@ -1674,7 +1752,11 @@ $ \fi \else \ifcase\SE@utfviii@CheckCont#5% \SE@InvalidCharacter - \def\SE@next{\SE@utfviii@from#5#6#7#8}% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{\SE@utfviii@from#5#6#7#8}% + \fi \else \ifnum"#1=14 % 1110 zzzz 10yy yyyy 10xx xxxx % zzzz yyyy yyxx xxxx @@ -1696,7 +1778,11 @@ $ \fi \fi \fi \SE@InvalidCharacter - \def\SE@next{\SE@utfviii@from#7#8}% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{\SE@utfviii@from#7#8}% + \fi \else \edef\SE@a{\SE@Nibble@NumToBin{"#3}}% \edef\SE@b{\SE@Nibble@NumToBin{"#5}}% @@ -1719,7 +1805,11 @@ $ \fi \else \ifcase\SE@utfviii@CheckCont#7% \SE@InvalidCharacter - \def\SE@next{\SE@utfviii@from#7#8}% + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \else + \def\SE@next{\SE@utfviii@from#7#8}% + \fi \else \let\SE@next\SE@utfviii@from \ifnum"#2<8 % 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx @@ -1734,9 +1824,15 @@ $ \fi \SE@Add\SE@w{\expandafter"\SE@w}{-1}% \ifnum\SE@w>15 % \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \ifnum\SE@w<\SE@zero \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \edef\SE@a{\SE@Nibble@NumToBin{"#5}}% \edef\SE@b{\SE@Nibble@NumToBin{"#7}}% @@ -1759,6 +1855,9 @@ $ \fi \fi \else \SE@InvalidCharacter + \if\SE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \fi \fi \fi @@ -1796,7 +1895,7 @@ $ \fi % % \begin{macrocode} %<*utf16le> -\ProvidesFile{se-utf16le.def}[2007/06/14 v1.0 stringenc: UTF-16LE] +\ProvidesFile{se-utf16le.def}[2007/06/16 v1.1 stringenc: UTF-16LE] % \end{macrocode} % % \begin{macrocode} @@ -1836,7 +1935,7 @@ $ \fi % % \begin{macrocode} %<*pdfdoc> -\ProvidesFile{se-pdfdoc.def}[2007/06/14 v1.0 stringenc: PDFDocEncoding] +\ProvidesFile{se-pdfdoc.def}[2007/06/16 v1.1 stringenc: PDFDocEncoding] % \end{macrocode} % % Pass ranges 32..126 and 160..255 through and use @@ -1875,10 +1974,12 @@ $ \fi % % \begin{macrocode} \expandafter\gdef\csname\SE@PrefixFrom pdfdoc\endcsname#1{% + \let\SE@next\SE@pdfdoc@from \expandafter\SE@pdfdoc@from#1\relax\relax } \gdef\SE@pdfdoc@from#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifcase\ifnum"#1#2>160 % \ifnum"#1#2="AD % @@ -1902,9 +2003,12 @@ $ \fi \SE@MapConvertFrom{pdfdoc}{#1#2}% \else \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \fi - \expandafter\SE@pdfdoc@from \fi + \SE@next } % \end{macrocode} % @@ -1962,7 +2066,7 @@ $ \fi % % \begin{macrocode} %<*iso-8859-1> -\ProvidesFile{se-iso-8859-1.def}[2007/06/14 v1.0 stringenc: ISO-8859-1] +\ProvidesFile{se-iso-8859-1.def}[2007/06/16 v1.1 stringenc: ISO-8859-1] % \end{macrocode} % % Excluded area: 0x80..0x9F @@ -1996,10 +2100,12 @@ $ \fi % % \begin{macrocode} \expandafter\gdef\csname\SE@PrefixFrom iso-8859-1\endcsname#1{% + \let\SE@next\SE@isoone@from \expandafter\SE@isoone@from#1\relax\relax } \gdef\SE@isoone@from#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifcase\ifnum"#1#2<"80 % \SE@one @@ -2011,11 +2117,14 @@ $ \fi \fi \fi \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \SE@ResultAdd{00#1#2}% \fi - \expandafter\SE@isoone@from \fi + \SE@next } % \end{macrocode} % @@ -2027,7 +2136,7 @@ $ \fi % % \begin{macrocode} %<*cp1252> -\ProvidesFile{se-cp1252.def}[2007/06/14 v1.0 stringenc: cp1252] +\ProvidesFile{se-cp1252.def}[2007/06/16 v1.1 stringenc: cp1252] % \end{macrocode} % % \begin{macrocode} @@ -2060,10 +2169,12 @@ $ \fi % % \begin{macrocode} \expandafter\gdef\csname\SE@PrefixFrom cp1252\endcsname#1{% + \let\SE@next\SE@ansinew@from \expandafter\SE@ansinew@from#1\relax\relax } \gdef\SE@ansinew@from#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifcase\ifnum"#1#2<"80 % \SE@one @@ -2078,8 +2189,8 @@ $ \fi \else \SE@ResultAdd{00#1#2}% \fi - \expandafter\SE@ansinew@from \fi + \SE@next } % \end{macrocode} % @@ -2126,7 +2237,7 @@ $ \fi % % \begin{macrocode} %<*ascii> -\ProvidesFile{se-ascii.def}[2007/06/14 v1.0 stringenc: US-ASCII] +\ProvidesFile{se-ascii.def}[2007/06/16 v1.1 stringenc: US-ASCII] % \end{macrocode} % % \begin{macrocode} @@ -2147,18 +2258,23 @@ $ \fi % % \begin{macrocode} \expandafter\gdef\csname\SE@PrefixFrom ascii\endcsname#1{% + \let\SE@next\SE@ascii@from \expandafter\SE@ascii@from#1\relax\relax } \gdef\SE@ascii@from#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifnum"#1>7 % \SE@InvalidCharacter + \ifSE@TestMode + \let\SE@next\SE@SkipRemaining + \fi \else \SE@ResultAdd{00#1#2}% \fi - \expandafter\SE@ascii@from \fi + \SE@next } % \end{macrocode} % @@ -2170,123 +2286,123 @@ $ \fi % % \begin{macrocode} %<*iso-8859-2> -\ProvidesFile{se-iso-8859-2.def}[2007/06/14 v1.0 stringenc: ISO-8859-2] +\ProvidesFile{se-iso-8859-2.def}[2007/06/16 v1.1 stringenc: ISO-8859-2] \def\SE@this{iso-8859-2} %</iso-8859-2> %<*iso-8859-3> -\ProvidesFile{se-iso-8859-3.def}[2007/06/14 v1.0 stringenc: ISO-8859-3] +\ProvidesFile{se-iso-8859-3.def}[2007/06/16 v1.1 stringenc: ISO-8859-3] \def\SE@this{iso-8859-3} %</iso-8859-3> %<*iso-8859-4> -\ProvidesFile{se-iso-8859-4.def}[2007/06/14 v1.0 stringenc: ISO-8859-4] +\ProvidesFile{se-iso-8859-4.def}[2007/06/16 v1.1 stringenc: ISO-8859-4] \def\SE@this{iso-8859-4} %</iso-8859-4> %<*iso-8859-5> -\ProvidesFile{se-iso-8859-5.def}[2007/06/14 v1.0 stringenc: ISO-8859-5] +\ProvidesFile{se-iso-8859-5.def}[2007/06/16 v1.1 stringenc: ISO-8859-5] \def\SE@this{iso-8859-5} %</iso-8859-5> %<*iso-8859-6> -\ProvidesFile{se-iso-8859-6.def}[2007/06/14 v1.0 stringenc: ISO-8859-6] +\ProvidesFile{se-iso-8859-6.def}[2007/06/16 v1.1 stringenc: ISO-8859-6] \def\SE@this{iso-8859-6} %</iso-8859-6> %<*iso-8859-7> -\ProvidesFile{se-iso-8859-7.def}[2007/06/14 v1.0 stringenc: ISO-8859-7] +\ProvidesFile{se-iso-8859-7.def}[2007/06/16 v1.1 stringenc: ISO-8859-7] \def\SE@this{iso-8859-7} %</iso-8859-7> %<*iso-8859-8> -\ProvidesFile{se-iso-8859-8.def}[2007/06/14 v1.0 stringenc: ISO-8859-8] +\ProvidesFile{se-iso-8859-8.def}[2007/06/16 v1.1 stringenc: ISO-8859-8] \def\SE@this{iso-8859-8} %</iso-8859-8> %<*iso-8859-9> -\ProvidesFile{se-iso-8859-9.def}[2007/06/14 v1.0 stringenc: ISO-8859-9] +\ProvidesFile{se-iso-8859-9.def}[2007/06/16 v1.1 stringenc: ISO-8859-9] \def\SE@this{iso-8859-9} %</iso-8859-9> %<*iso-8859-10> -\ProvidesFile{se-iso-8859-10.def}[2007/06/14 v1.0 stringenc: ISO-8859-10] +\ProvidesFile{se-iso-8859-10.def}[2007/06/16 v1.1 stringenc: ISO-8859-10] \def\SE@this{iso-8859-10} %</iso-8859-10> %<*iso-8859-11> -\ProvidesFile{se-iso-8859-11.def}[2007/06/14 v1.0 stringenc: ISO-8859-11] +\ProvidesFile{se-iso-8859-11.def}[2007/06/16 v1.1 stringenc: ISO-8859-11] \def\SE@this{iso-8859-11} %</iso-8859-11> %<*iso-8859-13> -\ProvidesFile{se-iso-8859-13.def}[2007/06/14 v1.0 stringenc: ISO-8859-13] +\ProvidesFile{se-iso-8859-13.def}[2007/06/16 v1.1 stringenc: ISO-8859-13] \def\SE@this{iso-8859-13} %</iso-8859-13> %<*iso-8859-14> -\ProvidesFile{se-iso-8859-14.def}[2007/06/14 v1.0 stringenc: ISO-8859-14] +\ProvidesFile{se-iso-8859-14.def}[2007/06/16 v1.1 stringenc: ISO-8859-14] \def\SE@this{iso-8859-14} %</iso-8859-14> %<*iso-8859-15> -\ProvidesFile{se-iso-8859-15.def}[2007/06/14 v1.0 stringenc: ISO-8859-15] +\ProvidesFile{se-iso-8859-15.def}[2007/06/16 v1.1 stringenc: ISO-8859-15] \def\SE@this{iso-8859-15} %</iso-8859-15> %<*iso-8859-16> -\ProvidesFile{se-iso-8859-16.def}[2007/06/14 v1.0 stringenc: ISO-8859-16] +\ProvidesFile{se-iso-8859-16.def}[2007/06/16 v1.1 stringenc: ISO-8859-16] \def\SE@this{iso-8859-16} %</iso-8859-16> %<*koi8-r> -\ProvidesFile{se-koi8-r.def}[2007/06/14 v1.0 stringenc: KOI8-R] +\ProvidesFile{se-koi8-r.def}[2007/06/16 v1.1 stringenc: KOI8-R] \def\SE@this{koi8-r} %</koi8-r> %<*nextstep> -\ProvidesFile{se-nextstep.def}[2007/06/14 v1.0 stringenc: NextStep] +\ProvidesFile{se-nextstep.def}[2007/06/16 v1.1 stringenc: NextStep] \def\SE@this{nextstep} %</nextstep> %<*mac-centeuro> -\ProvidesFile{se-mac-centeuro.def}[2007/06/14 v1.0 stringenc: Mac OS Central European] +\ProvidesFile{se-mac-centeuro.def}[2007/06/16 v1.1 stringenc: Mac OS Central European] \def\SE@this{mac-centeuro} %</mac-centeuro> %<*mac-cyrillic> -\ProvidesFile{se-mac-cyrillic.def}[2007/06/14 v1.0 stringenc: Mac OS Cyrillic] +\ProvidesFile{se-mac-cyrillic.def}[2007/06/16 v1.1 stringenc: Mac OS Cyrillic] \def\SE@this{mac-cyrillic} %</mac-cyrillic> %<*mac-roman> -\ProvidesFile{se-mac-roman.def}[2007/06/14 v1.0 stringenc: Mac OS Roman] +\ProvidesFile{se-mac-roman.def}[2007/06/16 v1.1 stringenc: Mac OS Roman] \def\SE@this{mac-roman} %</mac-roman> %<*dec-mcs> -\ProvidesFile{se-dec-mcs.def}[2007/06/14 v1.0 stringenc: DEC-MCS] +\ProvidesFile{se-dec-mcs.def}[2007/06/16 v1.1 stringenc: DEC-MCS] \def\SE@this{dec-mcs} %</dec-mcs> %<*cp437> -\ProvidesFile{se-cp437.def}[2007/06/14 v1.0 stringenc: cp437] +\ProvidesFile{se-cp437.def}[2007/06/16 v1.1 stringenc: cp437] \def\SE@this{cp437} %</cp437> %<*cp850> -\ProvidesFile{se-cp437.def}[2007/06/14 v1.0 stringenc: cp850] -\def\SE@this{cp437} +\ProvidesFile{se-cp850.def}[2007/06/16 v1.1 stringenc: cp850] +\def\SE@this{cp850} %</cp850> %<*cp852> -\ProvidesFile{se-cp437.def}[2007/06/14 v1.0 stringenc: cp852] -\def\SE@this{cp437} +\ProvidesFile{se-cp852.def}[2007/06/16 v1.1 stringenc: cp852] +\def\SE@this{cp852} %</cp852> %<*cp855> -\ProvidesFile{se-cp855.def}[2007/06/14 v1.0 stringenc: cp855] +\ProvidesFile{se-cp855.def}[2007/06/16 v1.1 stringenc: cp855] \def\SE@this{cp855} %</cp855> %<*cp858> -\ProvidesFile{se-cp858.def}[2007/06/14 v1.0 stringenc: cp858] +\ProvidesFile{se-cp858.def}[2007/06/16 v1.1 stringenc: cp858] \def\SE@this{cp858} %</cp858> %<*cp865> -\ProvidesFile{se-cp865.def}[2007/06/14 v1.0 stringenc: cp865] +\ProvidesFile{se-cp865.def}[2007/06/16 v1.1 stringenc: cp865] \def\SE@this{cp865} %</cp865> %<*cp866> -\ProvidesFile{se-cp866.def}[2007/06/14 v1.0 stringenc: cp866] +\ProvidesFile{se-cp866.def}[2007/06/16 v1.1 stringenc: cp866] \def\SE@this{cp866} %</cp866> %<*cp1250> -\ProvidesFile{se-cp1250.def}[2007/06/14 v1.0 stringenc: cp1250] +\ProvidesFile{se-cp1250.def}[2007/06/16 v1.1 stringenc: cp1250] \def\SE@this{cp1250} %</cp1250> %<*cp1251> -\ProvidesFile{se-cp1251.def}[2007/06/14 v1.0 stringenc: cp1251] +\ProvidesFile{se-cp1251.def}[2007/06/16 v1.1 stringenc: cp1251] \def\SE@this{cp1251} %</cp1251> %<*cp1257> -\ProvidesFile{se-cp1257.def}[2007/06/14 v1.0 stringenc: cp1257] +\ProvidesFile{se-cp1257.def}[2007/06/16 v1.1 stringenc: cp1257] \def\SE@this{cp1257} %</cp1257> % \end{macrocode} @@ -2306,18 +2422,20 @@ $ \fi \SE@InvalidCharacter } \def\SE@from@general#1{% + \let\SE@next\SE@@from@general \expandafter\SE@@from@general#1\relax\relax } \def\SE@@from@general#1#2{% \ifx#1\relax + \let\SE@next\relax \else \ifnum"#1<8 % "#1#2<128 \SE@ResultAdd{00#1#2}% \else \SE@MapConvertFrom\SE@encoding{#1#2}% \fi - \expandafter\SE@@from@general \fi + \SE@next } % \end{macrocode} % \begin{macrocode} @@ -5772,7 +5890,7 @@ $ \fi \catcode`\%=14 % \catcode`\ =10 % \catcode13=5 % - \usepackage{stringenc}[2007/06/14]% + \usepackage{stringenc}[2007/06/16]% \RestoreCatcodes } \Test @@ -5822,7 +5940,7 @@ $ \fi \let\SavedNumexpr\numexpr \let\numexpr\relax \fi -\usepackage{stringenc}[2007/06/14] +\usepackage{stringenc}[2007/06/16] \ifx\plainmode Y \let\numexpr\SavedNumexpr \fi @@ -5831,14 +5949,28 @@ $ \fi \LogTests{log}{*}{*} \def\Test#1#2#3#4#5{% + \begingroup + \edef\x{\endgroup + \noexpand\TestTest{#1}{#2}{#3}{#4}#5||\noexpand\NIL + }% + \x +} +\def\TestTest#1#2#3#4#5|#6|#7\NIL{% \begin{qstest}{encodings}{encodings, conversion} \setbox0=\hbox{% \def\par{p}% \EdefUnescapeHex\IN{#4}% \StringEncodingConvert\RESULT\IN{#1}{#2}% \EdefEscapeHex\RESULT\RESULT - \Expect*{\RESULT}*{#5}% + \Expect*{\RESULT}*{#5#6}% \Expect*{\StringEncodingSuccessFailure{true}{false}}{#3}% + \StringEncodingSuccessFailure{}{% + \StringEncodingConvertTest\RESULT\IN{#1}{#2}{% + }{% + \EdefEscapeHex\RESULT\RESULT + \Expect*{\RESULT}{#5}% + }% + }% }% \Expect*{\the\wd0}{0.0pt} \end{qstest} @@ -5916,14 +6048,14 @@ $ \fi {004D04304E8CD800DF02}% \Test{utf32be}{utf16be}{false}{FFFFFFFF}{} \Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF}{004D} -\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004D}{004D} -\Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF00000430}{004D0430} -\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004DFFFFFFFF}{004D} +\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004D}{|004D} +\Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF00000430}{004D|0430} +\Test{utf32be}{utf16be}{false}{FFFFFFFF0000004DFFFFFFFF}{|004D} \Test{utf32be}{utf16be}{false}{FFFFFF}{} \Test{utf32be}{utf16be}{false}{0000004DFFFFFF}{004D} \Test{utf32be}{utf16be}{false}{FFFFFF0000004D}{} \Test{utf32be}{utf16be}{false}{0000004DFFFFFF00000430}{004D} -\Test{utf32be}{utf16be}{false}{FFFFFF0000004DFFFFFF}{4DFF} +\Test{utf32be}{utf16be}{false}{FFFFFF0000004DFFFFFF}{|4DFF} \Test{utf32be}{utf16be}{false}{FFFF}{} \Test{utf32be}{utf16be}{false}{0000004DFFFF}{004D} \Test{utf32be}{utf16be}{false}{FFFF0000004D}{} @@ -5948,43 +6080,46 @@ $ \fi \Test{utf8}{utf32}{true}% {007FC280EFBFBFF0908080F48FBFBF}% {000000000000007F000000800000FFFF000100000010FFFF}% +\Test{utf8}{utf16}{false}{64F57F}{|0064007F} +\Test{utf8}{utf16}{false}{64FE7F}{|0064007F} +\Test{utf8}{utf16}{false}{64FF7F}{|0064007F} \Test{utf8}{utf16}{false}{80}{} -\Test{utf8}{utf16}{false}{7F807F}{007F007F} +\Test{utf8}{utf16}{false}{7F807F}{007F|007F} \Test{utf8}{utf16}{false}{C0}{} -\Test{utf8}{utf16}{false}{7FC07F}{007F007F} +\Test{utf8}{utf16}{false}{7FC07F}{|007F007F} \Test{utf8}{utf16}{false}{C1}{} -\Test{utf8}{utf16}{false}{7FC17F}{007F007F} +\Test{utf8}{utf16}{false}{7FC17F}{|007F007F} \Test{utf8}{utf16}{false}{C080}{} \Test{utf8}{utf16}{false}{C2}{} \Test{utf8}{utf16}{false}{C2CF}{} -\Test{utf8}{utf16}{false}{12C27F}{0012007F} +\Test{utf8}{utf16}{false}{12C27F}{0012|007F} \Test{utf8}{utf16}{true}{C280}{0080} \Test{utf8}{utf16}{true}{DFBF}{07FF} \Test{utf8}{utf16}{false}{E0}{} -\Test{utf8}{utf16}{false}{E07F}{007F} +\Test{utf8}{utf16}{false}{E07F}{|007F} \Test{utf8}{utf16}{false}{E0A0}{} -\Test{utf8}{utf16}{false}{E0A07F}{007F} +\Test{utf8}{utf16}{false}{E0A07F}{|007F} \Test{utf8}{utf16}{false}{E08080}{} -\Test{utf8}{utf16}{false}{E080807F}{007F} +\Test{utf8}{utf16}{false}{E080807F}{|007F} \Test{utf8}{utf16}{true}{ED8080}{D000} \Test{utf8}{utf16}{true}{ED9FBF}{D7FF} \Test{utf8}{utf16}{true}{EE8080}{E000} \Test{utf8}{utf16}{true}{EFBFBF}{FFFF} \Test{utf8}{utf32}{false}{F0}{} -\Test{utf8}{utf32}{false}{F07F}{0000007F} +\Test{utf8}{utf32}{false}{F07F}{|0000007F} \Test{utf8}{utf32}{false}{F090}{} -\Test{utf8}{utf32}{false}{F0907F}{0000007F} +\Test{utf8}{utf32}{false}{F0907F}{|0000007F} \Test{utf8}{utf32}{false}{F09080}{} -\Test{utf8}{utf32}{false}{F090807F}{0000007F} +\Test{utf8}{utf32}{false}{F090807F}{|0000007F} \Test{utf8}{utf32}{true}{F0908080}{00010000} \Test{utf8}{utf32}{false}{F0808080}{} -\Test{utf8}{utf32}{false}{F08080807F}{0000007F} +\Test{utf8}{utf32}{false}{F08080807F}{|0000007F} \Test{utf8}{utf32}{true}{F1808080}{00040000} \Test{utf8}{utf32}{true}{F3BFBFBF}{000FFFFF} \Test{utf8}{utf32}{true}{F4808080}{00100000} \Test{utf8}{utf32}{true}{F48FBFBF}{0010FFFF} \Test{utf8}{utf32}{false}{F4BFBFBF}{} -\Test{utf8}{utf32}{false}{F4BFBFBF7F}{0000007F} +\Test{utf8}{utf32}{false}{F4BFBFBF7F}{|0000007F} \Test{utf16be}{utf8}{true}{0000}{00} \Test{utf16be}{utf8}{true}{007F}{7F} \Test{utf16be}{utf8}{true}{0080}{C280} @@ -6006,6 +6141,7 @@ $ \fi \Test{utf32be}{utf8}{true}{00100000}{F4808080} \Test{utf32be}{utf8}{true}{0010FFFF}{F48FBFBF} \Test{utf32be}{utf8}{false}{00110000}{} +\Test{utf32be}{utf8}{false}{001100000000007F}{|7F} % \end{macrocode} % % \subsubsection{ASCII} @@ -6014,12 +6150,12 @@ $ \fi \Test{ascii}{utf8}{true}{007F}{007F} \Test{ascii}{utf8}{false}{80}{} \Test{ascii}{utf8}{false}{80}{} -\Test{ascii}{utf8}{false}{807F}{7F} +\Test{ascii}{utf8}{false}{807F}{|7F} \Test{utf16be}{ascii}{true}{0000007F}{007F} \Test{utf16be}{ascii}{false}{0080}{} \Test{utf16be}{ascii}{false}{0430}{} \Test{utf16be}{ascii}{false}{D800DF02}{} -\Test{utf16be}{ascii}{false}{D800DF02007F}{7F} +\Test{utf16be}{ascii}{false}{D800DF02007F}{|7F} \Test{ascii}{utf16be}{true}\AllBytesLow\AllUnicodesLow \Test{utf16be}{ascii}{true}\AllUnicodesLow\AllBytesLow % \end{macrocode} @@ -6058,7 +6194,7 @@ $ \fi {0001020304050607080B0C0E0F10111213141516177F9FAD}% {}% \Test{pdfdoc}{utf16be}{true}\pdfdocSlots\pdfdocUnicodes -\Test{pdfdoc}{utf16be}{false}\AllBytes\pdfdocUnicodes +\Test{pdfdoc}{utf16be}{false}\AllBytes{|\pdfdocUnicodes}% \Test{utf16be}{pdfdoc}{true}\pdfdocUnicodes\pdfdocSlots \Test{utf16be}{pdfdoc}{true}{FEFF0054006500730074}{54657374} % \end{macrocode} @@ -6068,9 +6204,9 @@ $ \fi % \begin{macrocode} \Test{iso-8859-1}{utf16be}{true}{007FA0FF}{0000007F00A000FF} \Test{iso-8859-1}{utf16be}{false}{80}{} -\Test{iso-8859-1}{utf16be}{false}{807F}{007F} +\Test{iso-8859-1}{utf16be}{false}{807F}{|007F} \Test{iso-8859-1}{utf16be}{false}{9F}{} -\Test{iso-8859-1}{utf16be}{false}{9F7F}{007F} +\Test{iso-8859-1}{utf16be}{false}{9F7F}{|007F} % \end{macrocode} % % \subsubsection{CP1252} @@ -6143,6 +6279,7 @@ $ \fi 00F100F200F300F400F500F6015300F800F900FA00FB00FC00FF% } \Test{dec-mcs}{utf16be}{true}\Slots\Unicodes +\Test{dec-mcs}{utf16be}{false}{C0BEC2}{00C0|00C2} \Test{utf16be}{dec-mcs}{true}\Unicodes\Slots % \end{macrocode} % @@ -6184,6 +6321,9 @@ $ \fi % \begin{description} % \item[\CTAN{macros/latex/contrib/oberdiek/oberdiek-tds.zip}] % \end{description} +% \emph{TDS} refers to the standard ``A Directory Structure +% for \TeX\ Files'' (\CTAN{tds/tds.pdf}). Directories +% with \xfile{texmf} in their name are usually organized this way. % % \subsection{Bundle installation} % @@ -6314,7 +6454,7 @@ $ \fi % \fi % \else % \lwbox -% \fi +% \fi % \else % \usebox0 % \fi @@ -6388,6 +6528,12 @@ $ \fi % \item % First version. % \end{Version} +% \begin{Version}{2007/06/16 v1.1} +% \item +% \cs{StringEncodingConvertTest} added. +% \item +% Fixes for cp850, cp852, nextstep. +% \end{Version} % \end{History} % % \PrintIndex |