Re[2]: [mp2] =?koi8-r?Q?=22?=Unrecognized character=?koi8-r?Q?=22=20?=error when running scripts inutf-8
[prev]
[thread]
[next]
[Date index for 2004/11/08]
------AJli3xTP-nF0J3tToy5ZOdeOp:1099915789
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 8bit
Hi everybody,
I hope this message will find its way to the thread I started on the list.
Thanks a lot to all the participants of the discussion, the problem was indeed in this BOM part of the scripts. Markus Wichitill <mawic@xxx.xx> has recommended to use popular shareware editor UltraEdit, which has two .ini options that prevent the adding of UTF-8 BOMs.
To those interested I put a more detailed error report which appeared in the log after I added
use Carp;
$SIG{__DIE__} = \&Carp::confess;
to my startup.pl file, as had been recommended by Stas Bekman <stas@xxxxxx.xxx>
[error] 2092: ModPerl::PerlRun: Unrecognized character \xEF at C:/shttps/CGI-FRLS/METSA/GET_LIST.PL line 1.
eval 'package ModPerl::ROOT::ModPerl::PerlRun::C_3a_shttps_CGI_2dFRLS_METSA_GET_LIST_2ePL;sub handler {local $0 = \'C:/shttps/CGI-FRLS/METSA/GET_LIST.PL\';
#line 1 C:/shttps/CGI-FRLS/METSA/GET_LIST.PL
use utf8;
binmode(STDOUT, ":raw:utf8");
print "Content-Type: text/html\\n\\n";
print "hello";
}
;' called at C:/Perl/site/lib/Apache2/ModPerl/RegistryCooker.pm line 665
ModPerl::RegistryCooker::compile('ModPerl::PerlRun=HASH(0x6c3384)', 'SCALAR(0x7c8388)') called at C:/Perl/site/lib/Apache2/ModPerl/RegistryCooker.pm line 374
ModPerl::RegistryCooker::convert_script_to_compiled_handler('ModPerl::PerlRun=HASH(0x6c3384)') called at C:/Perl/site/lib/Apache2/ModPerl/RegistryCooker.pm line 145
ModPerl::RegistryCooker::default_handler('ModPerl::PerlRun=HASH(0x6c3384)') called at C:/Perl/site/lib/Apache2/ModPerl/PerlRun.pm line 16
ModPerl::PerlRun::handler('ModPerl::PerlRun', 'Apache::RequestRec=SCALAR(0x6c32b8)') called at C:/shttps/CGI-FRLS/METSA/GET_LIST.PL line 1
eval {...} called at C:/shttps/CGI-FRLS/METSA/GET_LIST.PL line 1
Terminating on signal SIGTERM(15)
Attached please find a sample of a BOMed script.
Please feel free to report the error/fix suggestion to the developers of the corresponding modules. I believe you will be able to do it much more professionally than me ;-)
Thanks again for your help!
Igor K.
-----Original Message-----
From: Markus Wichitill <mawic@xxx.xx>
To: Igor Kudashev<igor_kudashev@xxxx.xx>
Date: Sun, 07 Nov 2004 16:37:59 +0100
Subject: Re: [mp2] "Unrecognized character" error when running scripts inutf-8
>
> Igor Kudashev wrote:
> > 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.
>
> Looks like the various ModPerl::RegistryCooker-based modules don't like a
> UTF-8 Byte Order Marker (BOM, "EF BB BF") at the start of the script
> (verified with 1.99_17). So until that can be fixed in a future version,
> you'll have to use an editor that can save files without a BOM, or remove
> those three bytes manually.
>
------AJli3xTP-nF0J3tToy5ZOdeOp:1099915789
Content-Type: application/octet-stream; name="test.pl"
Content-Disposition: attachment; filename="test.pl"
Content-Transfer-Encoding: base64
77u/dXNlIHV0Zjg7DQpiaW5tb2RlKFNURE9VVCwgIjpyYXc6dXRmOCIpOw0KcHJpbnQgIkNvbnRl
bnQtVHlwZTogdGV4dC9odG1sXG5cbiI7DQpwcmludCAiaGVsbG8iOw==
------AJli3xTP-nF0J3tToy5ZOdeOp:1099915789
Content-Type: text/plain; charset=us-ascii
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
------AJli3xTP-nF0J3tToy5ZOdeOp:1099915789--
 |
(message missing)
|