| View previous topic :: View next topic |
| Author |
Message |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Mon Sep 30, 2013 8:17 am Post subject: [Solved] color codes not interpreted but displayed |
|
|
Hello there,
I've a small tcl containing sentences with color code, as : "\0034Alert\003 : error in code"
These sentences are loaded in an array in my script, but when the line is used by my script, I get the color code in the channel.
Here is the way I load the sentences:
| Code: | proc file:load {} {
set jp [open $::filename "r"]
set jdata [read -nonewline $jp]
close $jp
set ::j_list ""
foreach templine [split $jdata "\n"] {
set line [split $templine "="]
set jkey [string tolower [lindex $line 0]]
lappend ::j_list $jkey
set ::key_gen($jkey) [lindex $line 1]
bind pubm - "*:$jkey*" file:display
}
} |
Any idea about this "bug" ?
[EDIT]
Making a small test, error appears when getting datas from a file. Seems to be an escape of \ ? _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Last edited by CrazyCat on Tue Oct 01, 2013 3:24 am; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Sep 30, 2013 1:41 pm Post subject: |
|
|
Escape sequences are never substituted when reading a file. If you trust the contents of the file to be safe, you could use subst to do the substitutions... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
|