You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Marcus R. Popetz" <mp...@netility.com> on 2001/03/06 01:46:55 UTC

url escaping with $escmode = 2.

$escmode = 2 (or 6)
The result of a Perl expression is always URL-escaped (e.g., `&' becomes 
`%26').

Is what the docs say.

My question is how to define 'perl expression':

Should this result in $message being url escaped?
[-
local $escmode = 2;
my $message = "A Message With Spaces";
$http_headers_out{'Location'} = "http://www.apple.com?message=" . $message;
exit();
-]

It does not and I haven't figured out a way to make it so...

-mp


Re: url escaping with $escmode = 2.

Posted by Gerald Richter <ri...@ecos.de>.
> $escmode = 2 (or 6)
> The result of a Perl expression is always URL-escaped (e.g., `&' becomes
> `%26').
>
> Is what the docs say.
>
> My question is how to define 'perl expression':
>

That means when you output a Perl expression e.g.

[+ $msg +]


> Should this result in $message being url escaped?
> [-
> local $escmode = 2;
> my $message = "A Message With Spaces";
> $http_headers_out{'Location'} = "http://www.apple.com?message=" .
$message;
> exit();
> -]
>

No, in this case there is no automatic escaping. Also it's on my todo list,
the escaping that Embperl provides, can't be used in this case. Currently
you need to use another Perlmodule e.g. URI::Escape

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------