This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

problem with £

Old posts that have not been replied to for several years.
Locked
t
tal0s

problem with £

Post by tal0s »

i'm writing a script for a buddy of mine and the channel name has the £ in it....however, the tcl script i'm writing won't do anything because of the £. here's a sample from the script:

Code: Select all

set chan1 "chan name omitted but contains two £"
set chan2 "chan name omitted and contains no £"
set msg1 "!test"

bind pubm - * pubm:all
proc pubm:all { nick uhost hand chan text } {
  global chan1
  global chan2
  global msg1

  if {$chan == $chan1} {
    if {[lindex [split $text] 0] == $msg1} {
      putserv "PRIVMSG $chan2 :$msg1"
    }
  }
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

#try changing this...
if {$chan == $chan1} {

#...to this
if {[string equal -nocase $chan $chan1]} { 
Elen sila lúmenn' omentielvo
t
tal0s

Post by tal0s »

nope, same problem.....i can change $chan1 to not include £ and it works, but as soon as it includes the symbol, nothing
t
tal0s

Post by tal0s »

changed it from:

Code: Select all

if {$chan == $chan1}
to:

Code: Select all

if {[string compare -nocase $chan $chan1]}
and it works now, thanks for the help :D
t
tal0s

Post by tal0s »

heh actually i wasn't thinking clearly and it still doesn't work...i just realized that it's only entering the if because it thinks the strings aren't equal
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

sounds like you've got an encoding problem.
Have you ever read "The Manual"?
t
tal0s

Post by tal0s »

solved the problem, used a wildcard character (?) to replace the single character that was causing the problem

Code: Select all

[string match "a?goeshere" "a£goeshere"]
Locked