[mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Markus Wichitill
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Stas Bekman
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.

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Markus Wichitill
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Stas Bekman
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Markus Wichitill
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Stas Bekman
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Markus Wichitill
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

Re: [mp2] Unrecognized character error when running scripts in utf-8

2004-11-07 Thread Stas Bekman
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