perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Игорь Кудашев <>
Subject [mp2] "Unrecognized character" error when running scripts in utf-8
Date Sun, 07 Nov 2004 13:23:21 GMT
Hi everybody. I ran into a problem with Perl scripts stored in utf-8 and I couldn't find the
answer to it on the Internet or mailing lists. Please tell me what I'm missing.

SYSTEM: Windows XP SP2, Active Perl, Apache 2.048, mod_perl 1.9912.

I need to run scripts stored in utf-8. Here is the code of a test SCRIPT:

use utf8;
binmode(STDOUT, ":raw:utf8");
print "Content-Type: text/html\n\n";
print "hello";

I use the Windows' Notepad and save the file as utf-8. Everything works fine while I run the
script from the command line or through CGI without mod_perl.
PROBLEM: When I try to run the script using mod_perl, I get the following ERROR:

[error] 3320: ModPerl::PerlRun: Unrecognized character \xEF at .../CGI-FOO/TEST.PL line 1.

Scripts stored in ANSI work fine with mod_perl, too.


LoadFile "C:/Perl/bin/perl58.dll"
LoadModule perl_module modules/
PerlSetEnv PATH "C:/Windows/System32;C:/Windows;C:/Perl;C:/Perl/Bin/"
PerlRequire "C:/Program files/Apache group/Apache2/conf/"

Alias /cgi-foo/ "C:/shttps/cgi-foo/"
<Location /cgi-foo>
    SetHandler perl-script
    PerlHandler ModPerl::PerlRun
    Options +ExecCGI -Indexes
    PerlOptions +ParseHeaders
    AllowOverride None
</Location> is reduced to:

use Apache2 (); 

but the longer version leads to the same results:

use Apache2 (); 
use ModPerl::Util (); 
use Apache::RequestRec (); 
use Apache::RequestIO (); 
use Apache::RequestUtil (); 
use Apache::Server (); 
use Apache::ServerUtil (); 
use Apache::Connection (); 
use Apache::Log (); 
use Apache::Const -compile => ':common'; 
use APR::Const -compile => ':common'; 
use APR::Table (); 
use Apache::compat (); 
#use ModPerl::Registry (); 

use CGI (); 
use DBI ();
use DBD::mysql ();

It seems as if mod_perl doesn't recognize the format of the script file correctly. Any tips
why this may occur? Thanks a bundle in advance!

Igor K

Report problems:
Mail list info:
List etiquette:

View raw message