<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1012141" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1012141</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070426</link>
    <description> &lt;p&gt;Hi Max,&lt;/p&gt;
&lt;p&gt;  You&#039;re welcome.&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Aug 2000 07:32:21 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1070426 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070393</link>
    <description> &lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;I didn&#039;t know there was a function like that.&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Aug 2000 00:34:00 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1070393 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070350</link>
    <description> &lt;p&gt;Hi Max,&lt;/p&gt;
&lt;p&gt;   Sorry for the delay.  I can blame the system being down, but...&lt;br /&gt;
   In my original post, I thought you were attempting to encrypt an entire message.&lt;br /&gt;
   If you are trying to encode for email/cgi, this is all you need:&lt;br /&gt;
endcodedMsg = escape(document.URLencode.message.value);&lt;br /&gt;
decoding would be:&lt;br /&gt;
decodedMsg = unescape(encodedMsg);&lt;br /&gt;
Vinny&lt;/p&gt;
 </description>
     <pubDate>Tue, 29 Aug 2000 16:50:31 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1070350 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070164</link>
    <description> &lt;p&gt;I guess I didn&#039;t delete it... I found it.&lt;/p&gt;
&lt;p&gt;I started working on it again this morning, but I&#039;m a bit fried and can&#039;t find what&#039;s wrong.  It doesn&#039;t work right now with the comments in, and it needs to work with them out (so the whole script can function).&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;amp;lt;script language=javascript&amp;amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;&lt;br /&gt;Character = new Array&lt;br /&gt;Character[0] = &amp;quot; &amp;quot;&lt;br /&gt;Character[1] = &amp;quot;/&amp;quot;&lt;br /&gt;Character[2] = &amp;quot;?&amp;quot;&lt;br /&gt;&lt;br /&gt;Encoded = new Array&lt;br /&gt;Encoded[0] = &amp;quot;%20&amp;quot;&lt;br /&gt;Encoded[1] = &amp;quot;%2F&amp;quot;&lt;br /&gt;Encoded[2] = &amp;quot;%3F&amp;quot;&lt;br /&gt;&lt;br /&gt;function Encode() {&lt;br /&gt;&lt;br /&gt;msg = URLencode.message.value&lt;br /&gt;&lt;br /&gt;if (msg == &amp;quot;&amp;quot;) {&lt;br /&gt;alert(&amp;quot;There is nothing to encode.\nThe text box is empty.&amp;quot;)&lt;br /&gt;return false&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;for (i=0; i&amp;lt;2; i++) {&lt;br /&gt;CheckFor(msg, i)&lt;br /&gt;} //End for (i=0; i&amp;lt;2; i++)&lt;br /&gt;&lt;br /&gt;document.URLencode.message.value = msg&lt;br /&gt;} //End Encode()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function CheckFor(msg, x) {&lt;br /&gt;&lt;br /&gt;if (msg.indexOf(Character(x)) &amp;gt; -1) {&lt;br /&gt;/*&lt;br /&gt;Replace(msg, x, msg.indexOf(Character(x)))&lt;br /&gt;*/&lt;br /&gt;} //End if (msg.indexOf(Character(x))&lt;br /&gt;else {&lt;br /&gt;return true&lt;br /&gt;} //End if (msg.indexOf(Character(x)) &amp;gt; -1)&lt;br /&gt;&lt;br /&gt;} //End function CheckFor(msg, x)&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;function Replace(msg, y, pos) {&lt;br /&gt;&lt;br /&gt;if (pos == &amp;quot;1&amp;quot;) {&lt;br /&gt;before = &amp;quot;&amp;quot;&lt;br /&gt;after = msg.substring(pos+1, msg.length)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (pos == msg.length) {&lt;br /&gt;before = msg.substring(0, pos-1)&lt;br /&gt;after= &amp;quot;&amp;quot;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ((pos != &amp;quot;0&amp;quot;) &amp;amp;&amp;amp; (pos != msg.length)) {&lt;br /&gt;before = msg.substring(0,pos-1)&lt;br /&gt;after = msg.substring(pos+1, msg.length)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;msg = before + &amp;quot;Encoded(y)&amp;quot; + after&lt;br /&gt;&lt;br /&gt;CheckFor(msg, y) //Any more?&lt;br /&gt;} //End function Replace(msg, y, pos)&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form name=URLencode onSubmit=&amp;quot;Encode(); return false;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;input name=message type=text size=40&amp;gt;&lt;br /&gt;&amp;lt;input type=button value=&amp;quot;Encode It!&amp;quot; onClick=&amp;quot;Encode()&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Aug 2000 18:16:58 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1070164 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070127</link>
    <description> &lt;p&gt;I don&#039;t care if anyone see&#039;s the code... I&#039;m trying to make a client side URL-encoder.&lt;/p&gt;
&lt;p&gt;could I do something like...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;String = &amp;quot;AaBxCcDc&amp;quot;&amp;nbsp; // will come from a text box&lt;br /&gt;num = String.indexOf(x)&lt;br /&gt;&lt;br /&gt;before = String.substring(0, num-1)&lt;br /&gt;after = String.substring(num+1, String.length)&lt;br /&gt;&lt;br /&gt;form.textbox.value = before + &amp;quot;b&amp;quot; + after&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;I had a more complex (but incomplete) version written earlier this week, but then I deleted it thinking that there HAD TO BE an easier way.&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Aug 2000 05:29:58 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1070127 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/replacing-characters-perls-s#comment-1070112</link>
    <description> &lt;p&gt;Hi Max,&lt;/p&gt;
&lt;p&gt;   string.indexOf(searchStr) provides the starting index of the string you are looking for.&lt;/p&gt;
&lt;p&gt;   Insofar as encoding: I don&#039;t recall of any such javascript methods, so you would have to write your own. The simpliest one I can think of is to up the character that is -- if character equals A then replace it with B.  However, that means that the encrypting algorythm would be visible to anyone who decided to rightClick.&lt;br /&gt;
  My recommendation: use perl or some other cgi friendly language.&lt;br /&gt;
Vinny&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 Aug 2000 03:16:10 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1070112 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
