From: Edwin Fine <efine145-nospam01 / usa.net>
Subject: Re: tk.rb warning in Turtle Graphics (#104)
Date: Sat, 2 Dec 2006 17:03:13 +0900
Message-ID: <26e18cd66a293ea06332d951983f9db6 / ruby-forum.com>
> warnings). These consisted of the following two warnings:
> 
> /usr/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=
> /usr/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding
> 
> followed by 27,688 repetitions of this warning:
> 
> /usr/lib/ruby/1.8/tk.rb:1187: warning: instance variable @encoding not 
> initialized

Don't worry about those. Those are no problem.

Redefinition of TclTkLib.encoding and encoding= depends on 
the difference between using 'tcltklib.so' only and with 'tk.rb'.

@encoding is used to check the encoding of a string. 
It depends that the value of non-initialized instance varible is nil.
Of course, if check the existence of the variable first, 
the warning will be removed.
But then, checking a string to pass to a Tcl/Tk interpreter needs 
two steps (check and refer).
Such check is called very frequently. So, I ignored the warning.
-- 
Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)