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

	<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>2024-06-18T02:19:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[doni]]></name></author>
		<updated>2024-06-17T12:02:10-04:00</updated>

		<published>2024-06-17T12:02:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112878#p112878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112878#p112878"/>
		<title type="html"><![CDATA[Re: replace letters with accent in string map]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112878#p112878"><![CDATA[
Great! Thanks!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12756">doni</a> — Mon Jun 17, 2024 12:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DasBrain]]></name></author>
		<updated>2024-06-17T11:22:54-04:00</updated>

		<published>2024-06-17T11:22:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112877#p112877</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112877#p112877"/>
		<title type="html"><![CDATA[Re: replace letters with accent in string map]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112877#p112877"><![CDATA[
Okay, the reason you get those characters is that the result is encoded as utf-8.<br>To fix it, put the result of http::data through encoding convertfrom utf-8.<br><div class="codebox"><p>Code: </p><pre><code>#############################################################    Oroscopo 1.5 tcl for eggdrop (22/03/2012)#    by lnx85 at #lnxlabs on SimosNap IRC Network (irc.simosnap.com)#    E-mail: lnx85@lnxlabs.it##    Per attivare lo script è necessario impostare il flag "+oroscopo" al canale #    (.chanset #chan +oroscopo)############################################################### GLOBALS ###set oroscopo(version) 1.5set ::http::defaultCharset utf-8package require httphttp::config -useragent "Mozilla/1.0"### END GLOBALS ###### FLAGS ###setudef flag oroscopo### END FLAGS###### BINDS ###bind pub - !oroscopo oroscopo:requestbind msgm - * oroscopo:pvt:request### END BINDS ###### PROCS ###proc strlastpos { string char {max 0} } {if { $max == 0} { set max [ string length $string ] }if { [ string length $string ] &lt;= $max } { return [ string length $string ] }for { set i 0 } { $i &lt; $max } { incr i } {if { [ string index $string [ expr $max - $i ] ] == $char } {return [ expr $max - $i ]}}return $max}proc max:privmsg:chars { target } {return [ expr 500 - 1 - [ string length $::nick ] - 30 - [ string length $target ] - 2 ]}proc oroscopo:pvt:request { nick uhost hand arg } {set arg [ lindex $arg 0 ]if { [ lsearch -exact {ariete toro gemelli cancro leone vergine bilancia scorpione sagittario capricorno acquario pesci} [ string tolower $arg ] ] == -1 } { return }regsub -all -- " " $arg "%20" argsset url "http://it.horoscopofree.com/rss/horoscopofree-it.rss"set http [ http::geturl $url ]set html [encoding convertfrom utf-8 [ http::data $http ]]http::cleanup $httpset flag 0if { [ regexp -nocase -all -- "&lt;item&gt;\[^&lt;\]*&lt;title&gt;($arg)&lt;/title&gt;\[^&lt;\]*&lt;link&gt;\[^&lt;\]*&lt;/link&gt;\[^&lt;\]*&lt;guid \[^&lt;\]*&lt;/guid&gt;\[^&lt;\]*&lt;description&gt;&lt;!\[^a-z\]CDATA\[^a-z\](\[^&lt;\]*?)" $html all segno testo ] } {set testosegno [lindex $testo [lsearch -exact $segno $args]]set risposta "\037OROSCOPO\037 \002::\002 \037[ string toupper $args ]\037 $testo"set flag 1}if { $flag == 0 } {putserv "PRIVMSG $nick :\037OROSCOPO\037 \002::\002 \037[strupr $arg]\037 Segno zodiacale non trovato"} else {set max_chars [ max:privmsg:chars $nick ]while { [ string length $risposta ] &gt; 0 } {set limit [ strlastpos $risposta " " $max_chars ]set risptemp [ string range $risposta 0 $limit ]set risposta [ string range $risposta $limit end ]if { [ string length $risposta ] != 0 } {putserv "PRIVMSG $nick :$risptemp ..."} else {putserv "PRIVMSG $nick :$risptemp"}}}}proc oroscopo:request { nick uhost hand chan arg } {if { [ lsearch -exact [ channel info $chan ] "+oroscopo" ] == -1 } { return }putlog "OROSCOPO :: request \"!oroscopo $arg\" from $nick!$uhost on $chan"if { $arg == "" || $arg == "help" } { putserv "NOTICE $nick :\037OROSCOPO\037 \002::\002 \037HELP\037 Mostra l'oroscopo per un dato segno zodiacale\037Utilizzo:\037 !oroscopo segno" return}regsub -all -- " " $arg "%20" argsset url "http://it.horoscopofree.com/rss/horoscopofree-it.rss"set http [ http::geturl $url ]set html [encoding convertfrom utf-8 [ http::data $http ]]http::cleanup $httpset flag 0if { [ regexp -nocase -all -- "&lt;item&gt;\[^&lt;\]*&lt;title&gt;($arg)&lt;/title&gt;\[^&lt;\]*&lt;link&gt;\[^&lt;\]*&lt;/link&gt;\[^&lt;\]*&lt;guid \[^&lt;\]*&lt;/guid&gt;\[^&lt;\]*&lt;description&gt;&lt;!\[^a-z\]CDATA\[^a-z\](\[^&lt;\]*?)" $html all segno testo ] } {set testosegno [lindex $testo [lsearch -exact $segno $args]]set risposta "\037OROSCOPO\037 \002::\002 \037[ string toupper $args ]\037 $testo"set flag 1}if { $flag == 0 } {putserv "PRIVMSG $chan :\037OROSCOPO\037 \002::\002 \037[strupr $arg]\037 Segno zodiacale non trovato"} else {set max_chars [ max:privmsg:chars $chan ]while { [ string length $risposta ] &gt; 0 } {set limit [ strlastpos $risposta " " $max_chars ]set risptemp [ string range $risposta 0 $limit ]set risposta [ string range $risposta $limit end ]if { [ string length $risposta ] != 0 } {putserv "PRIVMSG $chan :$risptemp ..."} else {putserv "PRIVMSG $chan :$risptemp"}}}}### END PROCS ###### INITIAL ###putlog "\037OROSCOPO\037 \002::\002 \037LOADED\037 version $oroscopo(version) by lnx85"</code></pre></div>You also want to use http::cleanup to release the resources for the http request, otherwise it will leak memory.<br>I added the relevant lines to your code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12909">DasBrain</a> — Mon Jun 17, 2024 11:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doni]]></name></author>
		<updated>2024-06-17T09:50:40-04:00</updated>

		<published>2024-06-17T09:50:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112876#p112876</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112876#p112876"/>
		<title type="html"><![CDATA[Re: replace letters with accent in string map]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112876#p112876"><![CDATA[
can you explain me how do it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12756">doni</a> — Mon Jun 17, 2024 9:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DasBrain]]></name></author>
		<updated>2024-06-17T09:32:58-04:00</updated>

		<published>2024-06-17T09:32:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112875#p112875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112875#p112875"/>
		<title type="html"><![CDATA[Re: replace letters with accent in string map]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112875#p112875"><![CDATA[
I think you want [encoding convertfrom utf-8] instead.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12909">DasBrain</a> — Mon Jun 17, 2024 9:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[doni]]></name></author>
		<updated>2024-06-18T02:19:22-04:00</updated>

		<published>2024-06-17T09:27:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112874#p112874</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112874#p112874"/>
		<title type="html"><![CDATA[replace letters with accent in string map]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112874#p112874"><![CDATA[
Hi guys<br>I would like to replace these letters with accent in this way with string map in <br>Ã -&gt; à or a'<br>Ã¹ -&gt; ù or u'<br>Ã¬ -&gt; ì or i'<br>Ã¨ -&gt; è or e'<br>Ã² -&gt; ò or o'<br><br>Someone can help me please? Thanks<br><div class="codebox"><p>Code: </p><pre><code>#</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12756">doni</a> — Mon Jun 17, 2024 9:27 am</p><hr />
]]></content>
	</entry>
	</feed>
