1#!/usr/bin/perl -w
2
3# Copyright 2008, 2009, 2010 Kevin Ryde
4
5# HTML-FormatExternal is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License as published
7# by the Free Software Foundation; either version 3, or (at your option) any
8# later version.
9#
10# HTML-FormatExternal is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13# for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with HTML-FormatExternal.  If not, see <http://www.gnu.org/licenses/>.
17
18use strict;
19use warnings;
20use Module::Load;
21use Data::Dumper;
22use Encode;
23use charnames ':full';
24$Data::Dumper::Useqq=1;
25
26foreach my $charset ('utf-16le','utf-16be','utf-32le','utf-32be') {
27  foreach my $str ("\N{BYTE ORDER MARK}",
28                   '<html><body><a href="page.html">Foo</a></body></html>',
29                   'http://foo.org/page.html') {
30    my $bytes = Encode::encode($charset, $str);
31    print Dumper(\$bytes);
32  }
33  print "\n";
34}
35exit 0;
36