<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/9240" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2005-03-02T15:22:47-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/9240</id>

		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-03-02T15:22:47-04:00</updated>

		<published>2005-03-02T15:22:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47139#p47139</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47139#p47139"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47139#p47139"><![CDATA[
not sur what you mean but to me it seems to work<br><blockquote class="uncited"><div>% set url<br><a href="http://domain.com/scs/info.php?username=%C2%A7ent%C2%A7%25%C3%BF%C3%AF%C2%BE" class="postlink">http://domain.com/scs/info.php?username=§ent§%ÿï¾</a>§<br>% urlEncode $url<br><a href="http://domain.com/scs/info.php?username=%A7ent%A7%25%Ff%EF%BE%A7" class="postlink">http://domain.com/scs/info.php?username ... f%ef%be%a7</a><br>%</div></blockquote>just curious probably wrong tho <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> not sur if i should remove the % from the exempt list<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Mar 02, 2005 3:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-02T15:18:44-04:00</updated>

		<published>2005-03-02T15:18:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47138#p47138</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47138#p47138"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47138#p47138"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc urlEncode {url} {  if {[regexp {(.*)\?(.*)} $url -&gt; pre sur]} {    set result ${pre}?    foreach {x} [split $sur {}] {      if {[regexp {[^a-zA-Z0-9=%]} $x]} {        append result "%[format %02x [scan $x %c]]"      } else {      append result $x      }    }    return $result  }  return $url}</code></pre></div>sorry edited it for got a %</div></blockquote>Just tried out your revision ofloo, but it still doesn't work with extended ascii characters (it just sends out the characters unchanged) <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>But atleast the slowurlencode proc does work, so I'm happy enough with that <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Wed Mar 02, 2005 3:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-02T15:14:12-04:00</updated>

		<published>2005-03-02T15:14:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47137#p47137</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47137#p47137"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47137#p47137"><![CDATA[
<blockquote class="uncited"><div>% time "urlEncode $url" 100<br>203 microseconds per iteration<br><br>% time "slowUrlEncode $url" 100<br>379 microseconds per iteration<br>%<br><br>here a simple proc that is bit faster then the one above .. <br><div class="codebox"><p>Code: </p><pre><code>proc urlEncode {url} {  if {[regexp {(.*)\?(.*)} $url -&gt; pre sur]} {    set result ${pre}?    foreach {x} [split $sur {}] {      if {[regexp {[^a-zA-Z0-9=%]} $x]} {        append result "%[format %02x [scan $x %c]]"      } else {      append result $x      }    }    return $result  }  return $url}</code></pre></div></div></blockquote>this proc doesn't seem to work with extended ascii chars, but the slowurlencode proc posted by user does work, anyway thanks alot to you all for your help with this!! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Wed Mar 02, 2005 3:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-03-02T15:10:45-04:00</updated>

		<published>2005-03-02T15:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47135#p47135</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47135#p47135"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47135#p47135"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc urlEncode {url} {  if {[regexp {(.*)\?(.*)} $url -&gt; pre sur]} {    set result ${pre}?    foreach {x} [split $sur {}] {      if {[regexp {[^a-zA-Z0-9=%]} $x]} {        append result "%[format %02x [scan $x %c]]"      } else {      append result $x      }    }    return $result  }  return $url}</code></pre></div>sorry edited it for got a %<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Mar 02, 2005 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-02T15:10:12-04:00</updated>

		<published>2005-03-02T15:10:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47134#p47134</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47134#p47134"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47134#p47134"><![CDATA[
<blockquote class="uncited"><div>sounds like an encoding bug...what is your system encoding?<div class="codebox"><p>Code: </p><pre><code>putlog "System encoding:  [encoding system]"</code></pre></div>try this proc:<div class="codebox"><p>Code: </p><pre><code>proc slowUrlEncode str {set out ""foreach c [split $str ""] {if {[string match {[A-Za-z0-9]} $c]} {append out $c} {append out [switch [string bytelen $c] {1 {format %%%.2X [scan $c %c]}2 {eval format %%%.2X%%%.2X [scan [encoding convertto utf-8 $c] %c%c]}3 {eval format %%%.2X%%%.2X%%%.2X [scan [encoding convertto utf-8 $c] %c%c%c]}}]}}set out}</code></pre></div></div></blockquote>awesome!!! that seems to work well, thanks alot m8! btw, my encoding is: iso8859-1<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Wed Mar 02, 2005 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-03-02T15:10:16-04:00</updated>

		<published>2005-03-02T15:07:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47133#p47133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47133#p47133"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47133#p47133"><![CDATA[
% time "urlEncode $url" 100<br>203 microseconds per iteration<br><br>% time "slowUrlEncode $url" 100<br>379 microseconds per iteration<br>%<br><br>here a simple proc that is bit faster then the one above .. <br><div class="codebox"><p>Code: </p><pre><code>proc urlEncode {url} {  if {[regexp {(.*)\?(.*)} $url -&gt; pre sur]} {    set result ${pre}?    foreach {x} [split $sur {}] {      if {[regexp {[^a-zA-Z0-9=%]} $x]} {        append result "%[format %02x [scan $x %c]]"      } else {      append result $x      }    }    return $result  }  return $url}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Mar 02, 2005 3:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-03-02T12:34:01-04:00</updated>

		<published>2005-03-02T12:34:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47132#p47132</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47132#p47132"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47132#p47132"><![CDATA[
sounds like an encoding bug...what is your system encoding?<div class="codebox"><p>Code: </p><pre><code>putlog "System encoding:  [encoding system]"</code></pre></div>try this proc:<div class="codebox"><p>Code: </p><pre><code>proc slowUrlEncode str {set out ""foreach c [split $str ""] {if {[string match {[A-Za-z0-9]} $c]} {append out $c} {append out [switch [string bytelen $c] {1 {format %%%.2X [scan $c %c]}2 {eval format %%%.2X%%%.2X [scan [encoding convertto utf-8 $c] %c%c]}3 {eval format %%%.2X%%%.2X%%%.2X [scan [encoding convertto utf-8 $c] %c%c%c]}}]}}set out}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Mar 02, 2005 12:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-03-02T12:10:58-04:00</updated>

		<published>2005-03-02T12:10:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47131#p47131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47131#p47131"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47131#p47131"><![CDATA[
got me beat  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  maybe just ban users with extended chars in there nicks <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> what you cant see wont hurt you  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Wed Mar 02, 2005 12:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-02T08:06:35-04:00</updated>

		<published>2005-03-02T08:06:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47126#p47126</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47126#p47126"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47126#p47126"><![CDATA[
<blockquote class="uncited"><div>try this proc for urlencode<br><div class="codebox"><p>Code: </p><pre><code>proc urlencode { text } {       regsub -all {\%} $text "%25" text     set i [string length $text]         # Loop through and replace all non alpha / numeric characters    # with their relevant %{HEX ascii code} values.    while {([regexp -nocase {[^a-z0-9%]} $text toh])&amp;&amp;!($i &lt; 0 )} {         scan "$toh" %c dec         regsub -all "\\${toh}" $text "%[format %X $dec]" text         incr i -1     }     if {$i &lt; 0} {putlog "Infinite loop something is very wrong: $text"}     return $text } </code></pre></div></div></blockquote>heya thanks for the input m8 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>I tried your proc, but when extended ascii characters are found in the trigger to call the p_userinfo proc, I get this error:<br><br>!uinfo §ent§<div class="codebox"><p>Code: </p><pre><code>Tcl error [p_userinfo]: couldn't compile regular expression pattern: invalid escape \ sequence</code></pre></div>but when using only normal ascii characters, your proc works fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Wed Mar 02, 2005 8:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-03-02T06:20:32-04:00</updated>

		<published>2005-03-02T06:20:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47125#p47125</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47125#p47125"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47125#p47125"><![CDATA[
try this proc for urlencode<br><div class="codebox"><p>Code: </p><pre><code>proc urlencode { text } {       regsub -all {\%} $text "%25" text     set i [string length $text]         # Loop through and replace all non alpha / numeric characters    # with their relevant %{HEX ascii code} values.    while {([regexp -nocase {[^a-z0-9%]} $text toh])&amp;&amp;!($i &lt; 0 )} {         scan "$toh" %c dec         regsub -all "\\${toh}" $text "%[format %X $dec]" text         incr i -1     }     if {$i &lt; 0} {putlog "Infinite loop something is very wrong: $text"}     return $text } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Wed Mar 02, 2005 6:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-02T06:10:57-04:00</updated>

		<published>2005-03-02T06:10:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47124#p47124</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47124#p47124"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47124#p47124"><![CDATA[
Just keeping this thread alive <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Does anybody have any ideas about getting certain extended ascii chars to translate?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Wed Mar 02, 2005 6:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-03-01T00:14:40-04:00</updated>

		<published>2005-03-01T00:14:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47090#p47090</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47090#p47090"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47090#p47090"><![CDATA[
sorry it took so long to get back again, but my cable was out most of the day..<br><br>ok, here is the latest code I'm using, and it represents all the additions from user (thanks again for your help m8):<br><div class="codebox"><p>Code: </p><pre><code>proc makeUrlencodeMap {} {   for {set i 0} {$i&lt;256} {incr i} {      set c [format %c $i]      if {![string match \[a-zA-Z0-9\] $c]} {         set tmp($c) %[format %.2X $i]      }   }   array set tmp {" " +   \n %0D%0A}   array get tmp}set urlencodeMap [makeUrlencodeMap]proc urlencode string {   string map $::urlencodeMap $string}proc p_userinfo { n u h c t } {  global scripturl ui_pass ui_salt  if {[userinfo:auth $c]} {    if { [llength [split $t]] &lt; "1" } {      putquick "PRIVMSG $c :\0034\002\[UINFO\]:\002 USAGE: \002!userinfo &lt;username&gt;\002\003"      return 0    }        set ft [join [list $t]]    set t "$ft"        set t [urlencode $t]    set agent "Mozilla"    set query "$scripturl?querytype=userinfo&amp;username=$t&amp;password=$ui_pass&amp;salt=$ui_salt"    set page [http::config -useragent $agent]    set page [http::geturl $query]    set lines [split [::http::data $page] \n]    set result [lindex $lines 1]    set output [string range [lindex $lines 1] 9 end]       if { [lrange "$result" 0 0] == "baduser" } {      putlog "\[UINFO\] sent query: $query"      putquick "PRIVMSG $c :\0034\002\[UINFO\]:\002 invalid username: \002$ft\002\003"      putlog "\0034\002\[UINFO\]:\002 ($c) \002$n\002 requested userinfo on invalid username: \002$ft\002\003"    }    if { [lrange "$result" 0 0] == "gooduser" } {      putlog "\[UINFO\] sent query: $query"      putserv "PRIVMSG $c :[string range [lindex $lines 1] 9 end]"      putserv "PRIVMSG $c :[lindex $lines 2]"      putlog "\0033\002\[UINFO\]:\002 ($c) \002$n\002 received userinfo on username: \002$ft\002\003"    }  }}</code></pre></div>when I call that p_userinfo proc (with !uinfo username), here's some examples of the http queries that gets sent out:<br><br>!uinfo somedude<div class="codebox"><p>Code: </p><pre><code>[UINFO] sent query: http://www.domain.com/scs/test.php?querytype=userinfo&amp;username=somedude&amp;password=48573434&amp;salt=fuuwy</code></pre></div>!uinfo some dude<div class="codebox"><p>Code: </p><pre><code>[UINFO] sent query: http://www.domain.com/scs/test.php?querytype=userinfo&amp;username=some+dude&amp;password=48573434&amp;salt=fuuwy</code></pre></div>!uinfo §ome dude§<div class="codebox"><p>Code: </p><pre><code>[UINFO] sent query: http://www.domain.com/scs/test.php?querytype=userinfo&amp;username=§ome+dude§&amp;password=48573434&amp;salt=fuuwy</code></pre></div>!uinfo ®en<div class="codebox"><p>Code: </p><pre><code>[UINFO] sent query: http://www.domain.com/scs/test.php?querytype=userinfo&amp;username=®en&amp;password=48573434&amp;salt=fuuwy</code></pre></div>So, extended ascii characters still are not getting changed to hex before they are sent out <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>ie, ® should get changed into %AE, and § should get changed into %A7<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Tue Mar 01, 2005 12:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-02-28T10:19:55-04:00</updated>

		<published>2005-02-28T10:19:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47054#p47054</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47054#p47054"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47054#p47054"><![CDATA[
I just add a line to putlog the value of $query to the partyline so I can see what is being sent out, and it shows that §ent§ gets sent out unaltered.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Mon Feb 28, 2005 10:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-02-28T10:13:21-04:00</updated>

		<published>2005-02-28T10:13:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47053#p47053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47053#p47053"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47053#p47053"><![CDATA[
<blockquote class="uncited"><div>the script doesn't change the string before it gets sent (ie, §ent§ remains the same and gets sent that way)</div></blockquote>How are you checking this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Feb 28, 2005 10:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blotter45]]></name></author>
		<updated>2005-02-28T09:54:50-04:00</updated>

		<published>2005-02-28T09:54:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47052#p47052</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47052#p47052"/>
		<title type="html"><![CDATA[help replacing some extended ascii characters]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47052#p47052"><![CDATA[
sorry I didn't see that code you pasted until after I typed that last reply.<br><br>but when I added your code, and then used this in that proc of mine above:<br><br>set t [urlencode $t]<br><br>the script doesn't change the string before it gets sent (ie, §ent§ remains the same and gets sent that way)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6025">blotter45</a> — Mon Feb 28, 2005 9:54 am</p><hr />
]]></content>
	</entry>
	</feed>
