You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Thoren Johne <th...@southern-division.de> on 2001/11/20 13:46:16 UTC

URL encoding

hi,

i have problem with the URL encoding capabilities of embperl.

assuming this code:

[- $name = 'mein name'; $myhash = { t1 => 'hallo welt', t2 => 'umlaut
ä' } -]
[- $escmode = 0 -]
<p><a href="?name=[+ $name +]">escmode 0</a></p>
<p><a href="?[+ $myhash +]">escmode 0</a></p>
[- $escmode = 1 -]
<p><a href="?name=[+ $name +]">escmode 1</a></p>
<p><a href="?[+ $myhash +]">escmode 1</a></p>
[- $escmode = 2 -]
<p><a href="?name=[+ $name +]">escmode 2</a></p>
<p><a href="?[+ $myhash +]">escmode 2</a></p>
[- $escmode = 3 -]
<p><a href="?name=[+ $name +]">escmode 3</a></p>
<p><a href="?[+ $myhash +]">escmode 3</a></p>

i get as result:

<p><a href="?name=mein name">escmode 0</a></p>
<p><a href="?t1=hallo welt&amp;t2=umlaut ä">escmode 0</a></p>
<p><a href="?name=mein name">escmode 1</a></p>
<p><a href="?t1=hallo welt&amp;t2=umlaut &auml;">escmode 1</a></p>
<p><a href="?name=mein%20name">escmode 2</a></p>
<p><a href="?t1=hallo%20welt&amp;t2=umlaut%20ä">escmode 2</a></p>
<p><a href="?name=mein%20name">escmode 3</a></p>
<p><a href="?t1=hallo%20welt&amp;t2=umlaut%20ä">escmode 3</a></p>

you see - the 'name=mein+name' never appears, also
the hash is never correct expanded - the umlaut 'ä' is not
encoded.

i'm using embperlobject 1.3.3, recent apache with recent mod_perl

what am i doing wrong?

any hints?

regards
thoren
8#X


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org