in reply to Apache+PerlCGI: accent problems

Did you mean "print $out1" ?

Anyway, a couple of things may be going wrong. One thing is that it's possible that the backticks don't interpret the command's output as UTF8.

Try this:

#!/usr/bin/perl use warnings; use strict; print "Content-type: text/html;charset=utf-8", "\n\n"; # open command and explicitly request utf-8 open (COMMAND,"-|:encoding(UTF-8)","java -classpath /usr/local/lib/CS. +jar csearch/CorpusSearch 'HTMLQ((naġ Exists))") or die $!; my $out1 = join('',<COMMAND>); # put all lines in one string binmode(STDOUT,":utf8"); # this marks the output as accepting utf8 print $out1;
You may also need to be careful about how you're reading the input data.

See also http://perldoc.perl.org/functions/open.html