The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

<html>
<head>
<title>Some tests for Embperl escaping</title>
</head>

<body>

Here it starts with some HTML Text<P>

First of all assign a value:
<BR>

Now we have some 'Umlaute':


Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  <BR>

What is the EscMode? 3
Now a Url: <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521">Here it goes</A>
A Tag 2:   <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521" TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21">a2</A>
A Tag 3:   <A  TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21" HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521" TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21">a3</A>
A Tag 4:   <A TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21" HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521">a4</A>
A Tag 5:   <A  TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21">a5</A>
A Tag 6:   <A >a6</A>
A Tag 7:   <A  HREF="7">x</A>
A Tag 8:   <A TARGET=8 HREF="8">x</A>
A Tag 9:   <A HREF="9" TARGET="9">x</A>
A Tag 10:  <A TARGET="10" HREF="10" TARGET="10">x</A>
A Tag 11:  <A  HREF="11"  >x</A>
^A Tag 12\:  <A HREF=(12|\"12\")>x<\/A>
^A Tag 12b\:  <A HREF=(12b|\"12b\") >x<\/A>
A Tag 13:  <A HREF="abcd%20%3E">x</A>
A Tag 14:  <A HREF="abcd%20%3E">x</A>
FRAME:	   <FRAME SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"  name="%20foo">
IFRAME:    <IFRAME SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521" name="%20foo">
EMBED:     <EMBED SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"  name="%20foo">
LAYER:	   <LAYER SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"  name="%20foo">
IMG:	   <IMG SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"    name="%20foo">
FORM:	   <FORM action="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"    name="%20foo">

Hash in  A <a href="http://localhost/tests?A=1&amp;B=2">
Array in A <a href="http://localhost/tests?X=9&amp;Y=8&amp;Z=7">

Hash in  H <a href="http://localhost/tests?A=1&amp;B=2">
^Array in H \<a href\=\"http\:\/\/localhost\/tests\?(X=9&amp;Y=8&amp;Z=7)|(Z=7&amp;X=9&amp;Y=8)\"\>

^<a href="tst.html\?(par1=1&amp;par2=2)|(par2=2&amp;par1=1)">1</a>
<a href="tst.html?par1=1&amp;par2=2&amp;par3=3">2</a>
<a href="tst.html?par1=1&amp;par2=2">3</a>
<a href="tst.html?par1=1&amp;par2=2&amp;par3=3">4</a>



			
1
Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  <BR>

What is the EscMode? 1
Now a Url: <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? &amp; + - %21">Here it goes</A>

2
Now lets look what we are getting from this:<BR>
(this%20is%20the%20value%20in%20$a) (this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20<BR>

What is the EscMode? 2
Now a Url: <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521">Here it goes</A>

0
Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) äöüäöü???<&+  <BR>

What is the EscMode? 0
Now a Url: <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? & + - %21">Here it goes</A>

3
Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  <BR>

What is the EscMode? 3
Now a Url: <A HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521">Here it goes</A>

What is the EscMode? 3
file.html?name=abcd&amp;data=xyz
Now we localy set $escmode:<BR>
(this is the value in $a) äöüäöü???<&+    \<a><BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    <a&gt;<BR>
(this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20%20%20<a%3E<BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    <a&gt;<BR>
(this is the value in $a) äöüäöü???<&+    \<a><BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    \&lt;a&gt;<BR>
(this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20%20%20\%3Ca%3E<BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    \&lt;a&gt;<BR>

Same without local:
(this is the value in $a) äöüäöü???<&+    \<a><BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    <a&gt;<BR>
(this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20%20%20<a%3E<BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    <a&gt;<BR>
(this is the value in $a) äöüäöü???<&+    \<a><BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    \&lt;a&gt;<BR>
(this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20%20%20\%3Ca%3E<BR>
(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    \&lt;a&gt;<BR>


Control Chars 0x80-0x9f:
&#128;&#129;&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#141;&#142;&#143;&#144;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#157;&#158;&#159;&nbsp;<BR>

Control Chars 129 & 130:
&amp;#129;&amp;#130;<BR>

0
^<A HREF=('http://host/script\?name=My%20Name%20öäü'|"http://host/script\?name=My%20Name%20öäü")>

^<A HREF=('http://host/script\?name=My%20Name%20öäü'|"http://host/script\?name=My%20Name%20öäü")>

0
^<A HREF=('http://host/script\?name=My%20Name%20öäü'|"http://host/script\?name=My%20Name%20öäü")>

^<A HREF=('http://host/script\?name=My Name öäü'|"http://host/script\?name=My Name öäü")>

<br>


We can avoid interpreting [- foo -] with a double [[ <br>

This should also work for [* foo *]  <br>


<A HREF="abcd%20>">x</A>

<table>
<TR>
 <TD><a href="1">Link</a></TD>
</TR>

<TR>
 <TD><a href="2">Link</a></TD>
</TR>

<TR>
 <TD><a href="3">Link</a></TD>
</TR>
</table>

<table>
<TR>
 <TD><a href="1">Link</a></TD>
</TR>

<TR>
 <TD><a href="2">Link</a></TD>
</TR>

<TR>
 <TD><a href="3">Link</a></TD>
</TR>
</table>

Escape method:

0: (this is the value in $a) äöüäöü???<&+  
1: (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  
2: (this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20
3: (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  
4: (this is the value in $a) äöüäöü???<&+  
5: (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  
6: (this%20is%20the%20value%20in%20$a)%20äöüäöü%3F%3F%3F%3C%26%2B%20%20
7: (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+  
<P>Ok.<P>


</body>
</html>