[Israel.pm] Hebrew with CGI

Guy Malachi guy at ucmore.com
Tue Jun 28 01:04:05 PDT 2005

I can't seem to do anything in the script once I pass it %uANYTHING in the URL.
I even changed my script to be
	print "Content-type:text/html\n\n";
	use Data::Dumper;
	print "<pre>";
	print Dumper \%ENV;
But once there is %u in the URL I get an error.
I played around with it a bit and it seems that if there is a % in the URL that is not followed immediately by two digits then my script fails.

Any ideas?
-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Omer Zak
Sent: Tuesday, June 28, 2005 12:10 AM
To: Perl in Israel
Subject: RE: [Israel.pm] Hebrew with CGI

1. What does your server log say? (It should write something to the log
whenever it responds with HTTP 500 error.)
2. Use a lower level module than CGI (or a callback function from CGI)
and add a function, which translates the URL string from %uXXXX based
one into %hh%hh based?
                                                           --- Omer

On Tue, 2005-06-28 at 00:37 +0200, Guy Malachi wrote:
> I can't really do that because the requests to my script come from bookmarklets that people run on various sites. The Hebrew that is passed is because the bookmarklet is run on a site that has a title in Hebrew.
> Basically people have a link the looks like this:
> <a href="javascript:document.location.href='http://mysite.com/myscript.pl?str= '+encodeURIComponent(document.title)">send site</a>
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Omer Zak
> Sent: Monday, June 27, 2005 10:53 PM
> To: Perl in Israel
> Subject: Re: [Israel.pm] Hebrew with CGI
> Try %D7%99 (obtained by encoding the string first to UTF-8 and then
> using the appropriate JavaScript encoding function).
>                                                        --- Omer
> On Mon, 2005-06-27 at 23:17 +0200, Guy Malachi wrote:
> > Hey guys,
> > I am trying to call my CGI script with a url like this:
> > http://mysite.com/myscript.pl?str=%u05D9
> > 
> > As soon as my script gets a "%u" in the URL it crashes (I get an HTTP 500 error).
> > Anybody have an idea how I can make this work?
> > 
> > BTW: the %u05D9 is created by encoding a string that has Hebrew characters in it by using JavaScript's encodeURIComponent.
> > 
> > My script is a simple CGI script that looks something like this:
> > 
> > use CGI;
> > my $q=new CGI;
> > print $q->header();
> > 
> > my $str=$q->param('str');
> > #do something with $str

Jara Cimerman!  He is one of the unsung geniuses--scientist, engineer,
inventor and literary critic.
My own blog is at http://www.livejournal.com/users/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

Perl mailing list
Perl at perl.org.il

More information about the Perl mailing list