Code: Select all
string map {\253 {} \273 {}} $str
Code: Select all
tag when posting logs, code
Code: Select all
bind pubm "m|m" *\00312TIME* dotime
proc 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: Select all
tag when posting logs, code
Code: Select all
% set a foo\273bar
foo?bar
% string map {\273 {}} $a
foobar
Code: Select all
tag when posting logs, code
Code: Select all
foreach c [split $str {}] {binary scan $c H2 x; putlog "$c \\x$x"}
Code: Select all
tag when posting logs, code
Code: Select all
In octal: \300-\377
In hexadecimal: \xC0-\xFF
Code: Select all
In octal: \200-\277
In hexadecimal: \x80-\xBF
Code: Select all
<awyeah> .tcl string length "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
<adapter> Tcl: 128
<awyeah> !test "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
<adapter> Remaining: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿"
Code: Select all
octal: \200-\277 and \300-\377
hexadecimal: \x80-\xFF
Code: Select all
In octal: \300-\377
In hexadecimal: \xC0-\xFF
Code: Select all
<awyeah> .tcl string map {"Š" "" "Œ" "" "Ž" "" "œ" "" "ž" "" "Ÿ" ""} "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> Tcl: werytyrtewretrwerwetertfg
<awyeah> .tcl string match "*Œ*" "werŠytyrtŽewreœtrwežrwetertŸfg"
<adapter> Tcl: 0
<awyeah> .tcl string match "*Œ*" "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> Tcl: 1
Code: Select all
bind pub - !test testing
proc 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: Select all
<awyeah> !test "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> String map: "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> No match found
Code: Select all
bind pub - !test testing
proc 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: Select all
<awyeah> !test "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> String map: "werŠŒytyrtŽewreœtrwežrwetertŸfg"
<adapter> No match found
However, strange as it may seem my shell provider has tcl version 8.4 and patch upto 8.4.11.* High-bit characters are being filtered from channel names. This is a
fault of the Tcl interpreter, and not Eggdrop. The Tcl interpreter
filters the characters when it reads a file for interpreting. Update
your Tcl to version 8.1 or higher.
* Version 8.1 of Tcl doesn't support unicode characters, for example, è.
If those characters are handled in a script as text, you run into errors.
Eggdrop can't handle these errors at the moment.
Code: Select all
bind pub - !test testing
proc 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: Select all
<awyeah> !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üýþÿ"
<adapter> CP1552: "df¬fdgdffg&d dsderyrt!Ædf`9R}dfertdfse"Ü"a:Serft~dsxtrydsrtsdfrtyrtdsffsddsfsddfsdtrysdfsdtytrrtjhmjhmmkhjrtmkhjk,hjh,kluihjkhjkuytiuyikwefsewrddssdfdfsffsfssdsdfsddstyfrtsdsdfsd"
<adapter> ISO8859-1: "dffdgdffgddsderyrtdfdfertdfseerftdstrydsrtsdfrtyrtdsffsddsfsddfsdtrysdfsdtytrrtjhmjhmmkhjrtmkhjk,hjh,kluihjkhjkuytiuyikwefsewrddssdfdfsffsfssdsdfsddstyfrtsdsdfsd"