use strict; use warnings; use HTML::Widget qw( ); my ($up) = @ARGV or die; my $s = chr(0xC9); if ($up) { utf8::upgrade($s); # Internally encoded as UTF-8 } else { utf8::downgrade($s); # Internally encoded as iso-latin-1 } my $w = HTML::Widget->new('widget')->method('GET'); $w->element('Textfield', 's')->label($s)->value($s); my $form = $w->process(); binmode(STDOUT, ':utf8'); print(<<"__EOI__"); Test

$s

$form __EOI__ #### >perl 759467.pl 0 > 0.html >perl 759467.pl 1 > 1.html >fc /b 0.html 1.html Comparing files 0.html and 1.HTML FC: no differences encountered