Eggheads: Charset encoding bug (could it be?)

Marco Ferra mferra at
Sat Jul 31 12:38:12 CST 2004


I think there's a bug concerning charset encodings.
(tested on eggdrop 1.6.12 and .16 on tcl8.3 - debian 3.0r2 if one cares)

For example:

bind pub "-" "!!" proc:blah

proc proc:blah {nc hs hd ch tx} {
  puthelp "notice $ch :* [string bytelength $tx]"

If $tx = "a" then bytelength returns 1
But if $tx = "á" then bytelength returns also 1 (oops!)

(notice the accent on the letter "a")

If $tx is written to a file and red back bytelength returns 2 (as it
should be).

Testing this on the interpreter $tx returns 2 in the first place.
Putting "á" directly in the source code does the same.  It seems to me
that internally $tx as returned by the binding stores the value as 1bit
when it should store in 2.  This is most evident when using iso8859-1.

Conversions using fconfigure and enconding convertto had no effect.
This problem came up when I've tried do string compare a value stored in
a file with one from a bind pub.

Please advise.

Sincere regards

Marco Ferra
mferra at

More information about the Eggheads mailing list