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 5.8.4.810, Apache 2.048, mod_perl 1.9912.
I need to run scripts stored in utf-8. Here
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
wrote:
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 5.8.4.810, Apache 2.048, mod_perl
1.9912.
I need to run scripts stored in utf-8.
Stas Bekman wrote:
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!
Wow! That's interesting.
Please take a look at the code in function
convert_script_to_compiled_handler at
Markus Wichitill wrote:
Stas Bekman wrote:
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!
Wow! That's interesting.
Please take a look at the code in function
convert_script_to_compiled_handler at
Stas Bekman wrote:
Markus Wichitill wrote:
The reason for the failure is pretty clear, the BOM ends up somewhere
in the middle of the string that is eval'ed to generate the package.
On Linux, I was able to fix that by removing the BOM in
RegistryCooker::read_script():
It's certainly a bad idea
Markus Wichitill wrote:
[...]
But first I would like to know why the script doesn't fail when run
outside mod_perl. We do nothing special here, other than read+eval,
compared to require. So it looks like a bug in perl.
No, Perl can deal with a BOM at the start of a file. But
Stas Bekman wrote:
Markus Wichitill wrote:
No, Perl can deal with a BOM at the start of a file. But
convert_script_to_compiled_handler() puts the BOM in the middle of the
string that is eval'ed. A bunch of raw bytes has no place in the
middle of a script.
Aha! Now it's clear. Thanks Markus.
Do
Markus Wichitill wrote:
Stas Bekman wrote:
Markus Wichitill wrote:
No, Perl can deal with a BOM at the start of a file. But
convert_script_to_compiled_handler() puts the BOM in the middle of
the string that is eval'ed. A bunch of raw bytes has no place in the
middle of a script.
Aha! Now it's