%%
%% This is file `stringenc-test2.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% stringenc.dtx  (with options: `test2')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file stringenc.dtx
%% and the derived files
%%    stringenc.sty, stringenc.pdf, stringenc.ins, stringenc.drv,
%%    se-utf32be.def, se-utf32le.def, se-utf8.def, se-utf16le.def,
%%    se-pdfdoc.def, se-iso-8859-1.def, se-cp1252.def,
%%    se-ascii.def, se-iso-8859-2.def, se-iso-8859-3.def,
%%    se-iso-8859-4.def, se-iso-8859-5.def, se-iso-8859-6.def,
%%    se-iso-8859-7.def, se-iso-8859-8.def, se-iso-8859-9.def,
%%    se-iso-8859-10.def, se-iso-8859-11.def, se-iso-8859-13.def,
%%    se-iso-8859-14.def, se-iso-8859-15.def, se-iso-8859-16.def,
%%    se-koi8-r.def, se-nextstep.def, se-mac-centeuro.def,
%%    se-mac-cyrillic.def, se-mac-roman.def, se-dec-mcs.def,
%%    se-cp437.def, se-cp850.def, se-cp852.def, se-cp855.def,
%%    se-cp858.def, se-cp865.def, se-cp866.def, se-cp1250.def,
%%    se-cp1251.def, se-cp1257.def, stringenc-test1.tex,
%%    stringenc-test2.tex.
%% 
\NeedsTeXFormat{LaTeX2e}
\nofiles
\documentclass{minimal}

\ifx\plainmode Y
  \let\SavedNumexpr\numexpr
  \let\numexpr\relax
\fi
\usepackage{stringenc}[2007/11/25]
\ifx\plainmode Y
  \let\numexpr\SavedNumexpr
\fi
\usepackage{qstest}
\IncludeTests{*}
\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#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}%
}

\def\AllBytesLow{%
  000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F%
  202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F%
  404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F%
  606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F%
}
\def\AllBytesHigh{%
  808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F%
  A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
  E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
}
\def\AllBytes{%
  \AllBytesLow
  \AllBytesHigh
}
\def\AllUnicodesLow{%
  0000000100020003000400050006000700080009000A000B000C000D000E000F%
  0010001100120013001400150016001700180019001A001B001C001D001E001F%
  0020002100220023002400250026002700280029002A002B002C002D002E002F%
  0030003100320033003400350036003700380039003A003B003C003D003E003F%
  0040004100420043004400450046004700480049004A004B004C004D004E004F%
  0050005100520053005400550056005700580059005A005B005C005D005E005F%
  0060006100620063006400650066006700680069006A006B006C006D006E006F%
  0070007100720073007400750076007700780079007A007B007C007D007E007F%
}
\Test{utf16be}{utf16be}{true}%
  {004D04304E8CD800DF02}%
  {004D04304E8CD800DF02}%
\Test{utf16}{utf16be}{true}%
  {004D04304E8CD800DF02}%
  {004D04304E8CD800DF02}%
\Test{utf16be}{utf16}{true}%
  {004D04304E8CD800DF02}%
  {004D04304E8CD800DF02}%
\Test{utf16}{utf16}{true}%
  {004D04304E8CD800DF02}%
  {004D04304E8CD800DF02}%
\Test{utf16}{utf16}{true}%
  {FEFF004D04304E8CD800DF02}%
  {004D04304E8CD800DF02}%
\Test{utf16}{utf16}{true}%
  {FFFE4D0030048C4E00D802DF}%
  {004D04304E8CD800DF02}%
\Test{utf16be}{utf32be}{true}%
  {004D04304E8CD800DF02}%
  {0000004D0000043000004E8C00010302}%
\Test{utf16be}{utf32le}{true}%
  {004D04304E8CD800DF02}%
  {4D000000300400008C4E000002030100}%
\Test{utf32be}{utf16}{true}%
  {0000004D0000043000004E8C00010302}%
  {004D04304E8CD800DF02}%
\Test{utf32le}{utf16}{true}%
  {4D000000300400008C4E000002030100}%
  {004D04304E8CD800DF02}%
\Test{utf32}{utf16}{true}%
  {0000004D0000043000004E8C00010302}%
  {004D04304E8CD800DF02}%
\Test{utf32}{utf16}{true}%
  {0000FEFF0000004D0000043000004E8C00010302}%
  {004D04304E8CD800DF02}%
\Test{utf32}{utf16}{true}%
  {FFFE00004D000000300400008C4E000002030100}%
  {004D04304E8CD800DF02}%
\Test{utf32be}{utf16be}{false}{FFFFFFFF}{}
\Test{utf32be}{utf16be}{false}{0000004DFFFFFFFF}{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}{FFFF}{}
\Test{utf32be}{utf16be}{false}{0000004DFFFF}{004D}
\Test{utf32be}{utf16be}{false}{FFFF0000004D}{}
\Test{utf32be}{utf16be}{false}{0000004DFFFF00000430}{004D}
\Test{utf32be}{utf16be}{false}{FF}{}
\Test{utf32be}{utf16be}{false}{0000004DFF}{004D}
\Test{utf32be}{utf16be}{false}{FF0000004D}{}
\Test{utf32be}{utf16be}{false}{0000004DFF00000430}{004D}
\Test{utf16be}{utf32be}{true}{DBBFDFFF}{000FFFFF}
\Test{utf16be}{utf8}{true}%
  {004D04304E8CD800DF02}%
  {4DD0B0E4BA8CF0908C82}%
\Test{utf32}{utf8}{true}%
  {000000000000007F000000800000FFFF000100000010FFFF}%
  {007FC280EFBFBFF0908080F48FBFBF}%
\Test{utf8}{utf16}{true}%
  {007FC280EFBFBFF0908080F48FBFBF}%
  {0000007F0080FFFFD800DC00DBFFDFFF}%
\Test{utf16}{utf32}{true}%
  {0000007F0080FFFFD800DC00DBFFDFFF}%
  {000000000000007F000000800000FFFF000100000010FFFF}%
\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}{007F|007F}
\Test{utf8}{utf16}{false}{C0}{}
\Test{utf8}{utf16}{false}{7FC07F}{|007F007F}
\Test{utf8}{utf16}{false}{C1}{}
\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}{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}{E0A0}{}
\Test{utf8}{utf16}{false}{E0A07F}{|007F}
\Test{utf8}{utf16}{false}{E08080}{}
\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}{F090}{}
\Test{utf8}{utf32}{false}{F0907F}{|0000007F}
\Test{utf8}{utf32}{false}{F09080}{}
\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}{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{utf16be}{utf8}{true}{0000}{00}
\Test{utf16be}{utf8}{true}{007F}{7F}
\Test{utf16be}{utf8}{true}{0080}{C280}
\Test{utf16be}{utf8}{true}{07FF}{DFBF}
\Test{utf16be}{utf8}{true}{0800}{E0A080}
\Test{utf16be}{utf8}{true}{0FFF}{E0BFBF}
\Test{utf16be}{utf8}{true}{1000}{E18080}
\Test{utf16be}{utf8}{true}{CFFF}{ECBFBF}
\Test{utf16be}{utf8}{true}{D000}{ED8080}
\Test{utf16be}{utf8}{true}{D7FF}{ED9FBF}
\Test{utf16be}{utf8}{false}{D800}{}
\Test{utf16be}{utf8}{false}{DFFF}{}
\Test{utf16be}{utf8}{true}{E000}{EE8080}
\Test{utf16be}{utf8}{true}{FFFF}{EFBFBF}
\Test{utf32be}{utf8}{true}{00010000}{F0908080}
\Test{utf32be}{utf8}{true}{0003FFFF}{F0BFBFBF}
\Test{utf32be}{utf8}{true}{00040000}{F1808080}
\Test{utf32be}{utf8}{true}{000FFFFF}{F3BFBFBF}
\Test{utf32be}{utf8}{true}{00100000}{F4808080}
\Test{utf32be}{utf8}{true}{0010FFFF}{F48FBFBF}
\Test{utf32be}{utf8}{false}{00110000}{}
\Test{utf32be}{utf8}{false}{001100000000007F}{|7F}
\Test{ascii}{utf8}{true}{007F}{007F}
\Test{ascii}{utf8}{false}{80}{}
\Test{ascii}{utf8}{false}{80}{}
\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{ascii}{utf16be}{true}\AllBytesLow\AllUnicodesLow
\Test{utf16be}{ascii}{true}\AllUnicodesLow\AllBytesLow
\def\pdfdocSlots{%
  090A0D18191A1B1C1D1E1F%
  202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F%
  404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F%
  606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E%
  808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E%
  A0A1A2A3A4A5A6A7A8A9AAABACAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
  E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
}
\def\pdfdocUnicodes{%
  0009000A000D02D802C702C602D902DD02DB02DA02DC%
  0020002100220023002400250026002700280029002A002B002C002D002E002F%
  0030003100320033003400350036003700380039003A003B003C003D003E003F%
  0040004100420043004400450046004700480049004A004B004C004D004E004F%
  0050005100520053005400550056005700580059005A005B005C005D005E005F%
  0060006100620063006400650066006700680069006A006B006C006D006E006F%
  0070007100720073007400750076007700780079007A007B007C007D007E%
  202220202021202620142013019220442039203A22122030201E201C201D2018%
  2019201A2122FB01FB020141015201600178017D0131014201530161017E%
  20AC00A100A200A300A400A500A600A700A800A900AA00AB00AC00AE00AF%
  00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF%
  00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
  00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF%
  00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
  00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF%
}
\Test{pdfdoc}{utf16be}{false}%
  {0001020304050607080B0C0E0F10111213141516177F9FAD}%
  {}%
\Test{pdfdoc}{utf16be}{true}\pdfdocSlots\pdfdocUnicodes
\Test{pdfdoc}{utf16be}{false}\AllBytes{|\pdfdocUnicodes}%
\Test{utf16be}{pdfdoc}{true}\pdfdocUnicodes\pdfdocSlots
\Test{utf16be}{pdfdoc}{true}{FEFF0054006500730074}{54657374}
\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}{9F}{}
\Test{iso-8859-1}{utf16be}{false}{9F7F}{|007F}
\def\Slots{%
  \AllBytesLow
  8082838485868788898A8B8C8E9192939495969798999A9B9C9E9F%
  A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
  E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
}
\def\Unicodes{%
  \AllUnicodesLow
  20AC201A0192201E20262020202102C62030016020390152017D%
  20182019201C201D20222013201402DC21220161203A0153017E0178%
  00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF%
  00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF%
  00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
  00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF%
  00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
  00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF%
}
\Test{cp1252}{utf16be}{false}{818D8F909D}{}
\Test{cp1252}{utf16be}{true}\Slots\Unicodes
\Test{utf16be}{cp1252}{true}\Unicodes\Slots
\def\Slots{%
  \AllBytesLow
  808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9F%
  A0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF%
  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF%
  E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF%
}
\def\Unicodes{%
  \AllUnicodesLow
  25002502250C251025142518251C2524252C2534253C258025842588258C2590%
  259125922593232025A02219221A22482264226500A0232100B000B200B700F7%
  25502551255204512553255425552556255725582559255A255B255C255D255E%
  255F25602561040125622563256425652566256725682569256A256B256C00A9%
  044E0430043104460434043504440433044504380439043A043B043C043D043E%
  043F044F044004410442044304360432044C044B04370448044D04490447044A%
  042E0410041104260414041504240413042504180419041A041B041C041D041E%
  041F042F042004210422042304160412042C042B04170428042D04290427042A%
}
\Test{koi8-r}{utf16be}{true}\Slots\Unicodes
\Test{utf16be}{koi8-r}{true}\Unicodes\Slots
\def\Slots{%
  \AllBytesLow
  A1A2A3A5A7A8A9AAABB0B1B2B3B5B6B7B9BABBBCBDBF%
  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD1D2D3D4D5D6D7D8D9DADBDCDDDF%
  E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF1F2F3F4F5F6F7F8F9FAFBFCFD%
}
\def\Unicodes{%
  \AllUnicodesLow
  00A100A200A300A500A700A400A900AA00AB%
  00B000B100B200B300B500B600B700B900BA00BB00BC00BD00BF%
  00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF%
  00D100D200D300D400D500D6015200D800D900DA00DB00DC017800DF%
  00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF%
  00F100F200F300F400F500F6015300F800F900FA00FB00FC00FF%
}
\Test{dec-mcs}{utf16be}{true}\Slots\Unicodes
\Test{dec-mcs}{utf16be}{false}{C0BEC2}{00C0|00C2}
\Test{utf16be}{dec-mcs}{true}\Unicodes\Slots
\Test{utf16be}{utf16be}{true}{FEFF}{}
\Test{utf16be}{utf16be}{true}{FFFE}{FFFE}
\Test{utf16le}{utf16le}{true}{FFFE}{}
\Test{utf16le}{utf16le}{true}{FEFF}{FEFF}
\Test{utf32be}{utf32be}{true}{0000FEFF}{}
\Test{utf32be}{utf32be}{true}{0000FFFE}{0000FFFE}
\Test{utf32le}{utf32le}{true}{FFFE0000}{}
\Test{utf32le}{utf32le}{true}{FEFF0000}{FEFF0000}
\csname @@end\endcsname
\endinput
%%
%% End of file `stringenc-test2.tex'.
