<?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/11325" />

	<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>2007-07-11T03:02:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-11T03:02:47-04:00</updated>

		<published>2007-07-11T03:02:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74352#p74352</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74352#p74352"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74352#p74352"><![CDATA[
Actually, I got it infact. Its quite easy, I readup today about encoding different ascii character sets, and then tested on some. The major two which can be used for this case are: cp1252 and iso8859-1.<br><br>I tried with cp1252 for the proc below, it didnot completely strip the characters and ended up with stripping some and leaving some weird characters as you can see in the output.<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !test testingproc testing {n u h c t} { regsub -all {[\200-\377]} [encoding convertfrom cp1252 $t] {} a putserv "privmsg #adapter :CP1252: $a" regsub -all {[\200-\377]} [encoding convertfrom iso8859-1 $t] {} b putserv "privmsg #adapter :ISO8859-1: $b"}</code></pre></div>When I used iso8859-1, everything was stripped off completely as I wanted it to be, see the results below. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>&lt;awyeah&gt; !test "df€fdgdf„fg…d†dsderyrt‡ˆdfŠ‹ŒŽdf‘’ertdfse“”•–—˜™š›œerftždsŸ trydsrt¡¢£¤¥¦sdf§¨©ª«¬­rtyrt®¯°dsf±fsd²³´µ¶·¸¹º»dsfsd¼½¾¿ÀÁÂdfsdtrysdfsdtytrrtÄÅÆjhÇÈmjhmÉÊËmkhjrtÌÍÎÏÐÑmkhjÓk,hÔÕjhØÙ,klÛÜuiÝÞhjßàákhjâãkuytiuyikåweæçèfsewrdêëdsìíîïsdfðdfsffsfsósdôsdfsddstyfrtsdö÷øùúûsdfsdüýþÿ"&lt;adapter&gt; CP1552: "df¬fdgdffg&amp;d dsderyrt!Ædf`9R}dfertdfse"Ü"a:Serft~dsxtrydsrtsdfrtyrtdsffsddsfsddfsdtrysdfsdtytrrtjhmjhmmkhjrtmkhjk,hjh,kluihjkhjkuytiuyikwefsewrddssdfdfsffsfssdsdfsddstyfrtsdsdfsd"&lt;adapter&gt; ISO8859-1: "dffdgdffgddsderyrtdfdfertdfseerftdstrydsrtsdfrtyrtdsffsddsfsddfsdtrysdfsdtytrrtjhmjhmmkhjrtmkhjk,hjh,kluihjkhjkuytiuyikwefsewrddssdfdfsffsfssdsdfsddstyfrtsdsdfsd"</code></pre></div>Hence to completely be able to use the complete range \200-\377 or \x80-\xFF you need to encode the text in the proc and convertfrom iso8859-1.<br><br>Mission successful!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Wed Jul 11, 2007 3:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-10T08:14:40-04:00</updated>

		<published>2007-07-10T08:14:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74319#p74319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74319#p74319"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74319#p74319"><![CDATA[
Follow up of my previous post. For testing:<br><br>In partyline I got this:<br><div class="codebox"><p>Code: </p><pre><code>&lt;awyeah&gt; .tcl string map {"Š" "" "Œ" "" "Ž" "" "œ" "" "ž" "" "Ÿ" ""} "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; Tcl: werytyrtewretrwerwetertfg&lt;awyeah&gt; .tcl string match "*Œ*" "werŠytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; Tcl: 0&lt;awyeah&gt; .tcl string match "*Œ*" "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; Tcl: 1</code></pre></div>This indicates everything is working correctly in partyline.<br>Now check, when I load the tcl into the bot and then test.<br><br>For this proc, (tcl loaded into the bot):<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !test testingproc testing {n u h c t} { set i [string map {"\x8A" "" "\x8C" "" "\x8E" "" "\x9C" "" "\x9E" "" "\x9F" ""} $t] putserv "PRIVMSG #adapter :String map: $i" if {[string match -nocase "*\x8C*" $t] || [string match -nocase "*\x9E*" $t]} { putserv "PRIVMSG #adapter :Match found" } else { putserv "PRIVMSG #adapter :No match found" }}</code></pre></div>and for the same string, I got these results:<br><div class="codebox"><p>Code: </p><pre><code>&lt;awyeah&gt; !test "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; String map: "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; No match found</code></pre></div>Means there is definately something wrong. <br>Evidently, I also check for this proc:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - !test testingproc testing {n u h c t} { set i [string map {"Š" "" "Œ" "" "Ž" "" "œ" "" "ž" "" "Ÿ" ""} $t] putserv "PRIVMSG #adapter :String map: $t" if {[string match -nocase "*Œ*" $t]} { putserv "PRIVMSG #adapter :Match found" } else { putserv "PRIVMSG #adapter :No match found" }}</code></pre></div>It also gave me the same result as above:<br><div class="codebox"><p>Code: </p><pre><code>&lt;awyeah&gt; !test "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; String map: "werŠŒytyrtŽewreœtrwežrwetertŸfg"&lt;adapter&gt; No match found</code></pre></div>Further more as a conclusion from what I've read there might be 2 identified problems for this case:<br><br>1) <a href="http://www.ascii.cl/htmlcodes.htm" class="postlink">http://www.ascii.cl/htmlcodes.htm</a> &lt;&lt; this page lists that characters from the range \x80-\xBF (or \200-\277) are NOT defined in HTML 4 standard<br>2) From: /eggdrop/docs/known-problems<br><blockquote class="uncited"><div>    * High-bit characters are being filtered from channel names. This is a<br>      fault of the Tcl interpreter, and not Eggdrop. The Tcl interpreter<br>      filters the characters when it reads a file for interpreting. Update<br>      your Tcl to version 8.1 or higher.<br><br>    * Version 8.1 of Tcl doesn't support unicode characters, for example, è.<br>      If those characters are handled in a script as text, you run into errors.<br>      Eggdrop can't handle these errors at the moment.</div></blockquote>However, strange as it may seem my shell provider has tcl version 8.4 and patch upto 8.4.11.<br><br>I think these major two are the basic problems, due to which my aim is not achievable. If anyone has anything to say or any comment, regarding my conclusion, please follow up my post.<br><br>Thanks,<br>JD<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jul 10, 2007 8:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-10T20:25:42-04:00</updated>

		<published>2007-07-10T06:50:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74318#p74318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74318#p74318"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74318#p74318"><![CDATA[
Actually hes right. Today I was working with this, researched deeply on this topic for 2-3hrs and tested my bot.<br><br>The only codes which can be <em class="text-italics">removed, stripped, detected</em> in string or list are from the following range:<br><div class="codebox"><p>Code: </p><pre><code>In octal: \300-\377In hexadecimal: \xC0-\xFF</code></pre></div>I tried everything from regexp, regsub and even string map, but the codes from in the range:<br><div class="codebox"><p>Code: </p><pre><code>In octal: \200-\277In hexadecimal: \x80-\xBF</code></pre></div>were not detected through anyway. For this I also performed some tests. Here is one of them shown.<br><br>In this one I use the whole range as you can see 128 chars and for regexp matching I used \200-\277 &amp; 300-\377 to detect, generally all should be detected, but only \300-\377 were detected.<br><div class="codebox"><p>Code: </p><pre><code>&lt;awyeah&gt; .tcl string length "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"&lt;adapter&gt; Tcl: 128&lt;awyeah&gt; !test "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"&lt;adapter&gt; Remaining: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿"</code></pre></div>Further I also used regsub to substitude and string map also, they gave me similar answers.<br><br>So my conclusion, for wasting the whole afternoon and working on this was that:<br><br>In the character range:<br><div class="codebox"><p>Code: </p><pre><code>octal: \200-\277 and \300-\377hexadecimal: \x80-\xFF</code></pre></div>Only the range:<br><div class="codebox"><p>Code: </p><pre><code>In octal: \300-\377In hexadecimal: \xC0-\xFF</code></pre></div>is detectable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jul 10, 2007 6:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-02-07T23:43:27-04:00</updated>

		<published>2006-02-07T23:43:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60213#p60213</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60213#p60213"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60213#p60213"><![CDATA[
you simply don't know your codes<br><br>print them out with:<div class="codebox"><p>Code: </p><pre><code>foreach c [split $str {}] {binary scan $c H2 x; putlog "$c \\x$x"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Feb 07, 2006 11:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bras]]></name></author>
		<updated>2006-02-07T17:46:10-04:00</updated>

		<published>2006-02-07T17:46:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60206#p60206</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60206#p60206"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60206#p60206"><![CDATA[
Just to show what I'm talking about... forgot about the <a href="http://img335.imageshack.us/img335/676/caracter9mh.jpg" class="postlink">image</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7330">bras</a> — Tue Feb 07, 2006 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bras]]></name></author>
		<updated>2006-02-07T10:09:25-04:00</updated>

		<published>2006-02-07T10:09:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60196#p60196</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60196#p60196"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60196#p60196"><![CDATA[
Yep... neither worked for me...<br><br>I found out that it's happening because there are color escapes near the characters I'm working with. Its not \003 though... are there (in case of yes, which are) any other ways to end a color escape besides \003 ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7330">bras</a> — Tue Feb 07, 2006 10:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2006-02-07T01:23:34-04:00</updated>

		<published>2006-02-07T01:23:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60189#p60189</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60189#p60189"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60189#p60189"><![CDATA[
try \xAB and \xBB<br><br>actually f*** that, if demond's suggestion doesnt work then min ewont either (PEBKAC)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Tue Feb 07, 2006 1:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-02-07T01:19:42-04:00</updated>

		<published>2006-02-07T01:19:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60188#p60188</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60188#p60188"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60188#p60188"><![CDATA[
really?<div class="codebox"><p>Code: </p><pre><code>% set a foo\273barfoo?bar% string map {\273 {}} $afoobar</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Feb 07, 2006 1:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bras]]></name></author>
		<updated>2006-02-07T00:44:21-04:00</updated>

		<published>2006-02-07T00:44:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60187#p60187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60187#p60187"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60187#p60187"><![CDATA[
I used string map too, didn't work neither.<br><blockquote class="uncited"><div>set data [string map {"\273" ""} $time]</div></blockquote>Can remove everything else but those signs. Can't understand why. Thanks anyway for your patience demond.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7330">bras</a> — Tue Feb 07, 2006 12:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-02-06T23:54:42-04:00</updated>

		<published>2006-02-06T23:54:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60185#p60185</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60185#p60185"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60185#p60185"><![CDATA[
get rid of that [replacevar] proc, Tcl has built-in proc for replacing string(s) within a string, it's called [string map] (there is also [string replace] of course, but it doesn't suit you for what you need)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Feb 06, 2006 11:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bras]]></name></author>
		<updated>2006-02-06T09:09:24-04:00</updated>

		<published>2006-02-06T09:09:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60161#p60161</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60161#p60161"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60161#p60161"><![CDATA[
Hi demond, thanks very much for getting some time to help me. You were right about the codes, however I don't know why I don't see to be able to strip them out. Here is what I'm doing<br><div class="codebox"><p>Code: </p><pre><code>bind pubm "m|m" *\00312TIME* dotimeproc replacevar {strin what withwhat} {        set output $strin        set replacement $withwhat        set cutpos 0        while { [string first $what $output] != -1 } {                set cutstart [expr [string first $what $output] - 1]                set cutstop  [expr $cutstart + [string length $what] + 1]                set output [string range $output 0 $cutstart]$replacement[string range $output $cutstop end]        }        return $output}proc dotime { nick host handle channel text } {set text [split $text]set time [lrange $text 5 end]set echo $time               set echo [replacevar $echo "\253" ""]set echo [replacevar $echo "\273" ""]    putserv "PRIVMSG #newsnet :$echo"}</code></pre></div>I don't know why the replacevar proc is not working for this characters. It has always worked for me. An example of the text where I'm stripping out would be:<br><br>In Rio de Janeiro : 23h 12m 30s «» TIME «»<br><br>What I want is only the time, which is not always in this format, that's why I'm trying to work with what is between : and «<br><br>Would you have any idea why I can't strip out « and » ?<br><br>Thanks again!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7330">bras</a> — Mon Feb 06, 2006 9:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-02-06T01:51:50-04:00</updated>

		<published>2006-02-06T01:51:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60152#p60152</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60152#p60152"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60152#p60152"><![CDATA[
\0171 and \0187 are invalid character escapes, they should be \253 and \273 (since 171 decimal is 253 octal and 187 is 273)<div class="codebox"><p>Code: </p><pre><code>string map {\253 {} \273 {}} $str</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Feb 06, 2006 1:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bras]]></name></author>
		<updated>2006-02-06T00:59:17-04:00</updated>

		<published>2006-02-06T00:59:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60149#p60149</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60149#p60149"/>
		<title type="html"><![CDATA[Striping out character]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60149#p60149"><![CDATA[
Hi,<br><br>I'm doing a script but I'm having some trouble to remove a character in a text. The text is «» TIME «»<br>I know that « is 171 in ASCII code and » 187, however I don't know how to represent them in a replacevar procedure. I tried:<br>set echo [replacevar $echo "\0171" ""]       <br>set echo [replacevar $echo "\0187" ""]<br><br>Obviously didn't work  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"> Anyone could help me ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7330">bras</a> — Mon Feb 06, 2006 12:59 am</p><hr />
]]></content>
	</entry>
	</feed>
