In Files

  • tk/lib/tk.rb

Class/Module Index [+]

Quicksearch

Tk::Encoding

Constants

TkCommandNames

Public Instance Methods

encoding() click to toggle source
 
               # File tk/lib/tk.rb, line 2355
def encoding
  TkCore::INTERP.encoding
end
            
encoding=(name) click to toggle source
 
               # File tk/lib/tk.rb, line 2351
def encoding=(name)
  TkCore::INTERP.encoding = name
end
            
encoding_convert_from(str, enc=nil) click to toggle source
encoding_convert_to(str, enc=nil) click to toggle source
Alias for: encoding_convertto
encoding_convertfrom(str, enc=nil) click to toggle source
 
               # File tk/lib/tk.rb, line 2371
def encoding_convertfrom(str, enc=nil)
  # str is an usual enc string or a Tcl's internal string expression
  # in enc (which is returned from 'encoding_convertto' method).
  # the return value is a UTF-8 string.
  enc = encoding_system unless enc
  ret = TkCore::INTERP.__invoke('encoding', 'convertfrom', enc, str)
  ret.instance_variable_set('@encoding', 'utf-8')
  ret
end
            
Also aliased as: encoding_convert_from, encoding_convert_from
encoding_convertto(str, enc=nil) click to toggle source
 
               # File tk/lib/tk.rb, line 2382
def encoding_convertto(str, enc=nil)
  # str must be a UTF-8 string.
  # The return value is a Tcl's internal string expression in enc.
  # To get an usual enc string, use Tk.fromUTF8(ret_val, enc).
  enc = encoding_system unless enc
  ret = TkCore::INTERP.__invoke('encoding', 'convertto', enc, str)
  ret.instance_variable_set('@encoding', 'binary')
  ret
end
            
Also aliased as: encoding_convert_to, encoding_convert_to
encoding_dirs() click to toggle source
 
               # File tk/lib/tk.rb, line 2393
def encoding_dirs
  # Tcl8.5 feature
  TkComm.simplelist(Tk.tk_call_without_enc('encoding', 'dirs'))
end
            
encoding_dirs=(dir_list) click to toggle source
 
               # File tk/lib/tk.rb, line 2398
def encoding_dirs=(dir_list) # an array or a Tcl's list string
  # Tcl8.5 feature
  Tk.tk_call_without_enc('encoding', 'dirs', dir_list)
end
            
encoding_names() click to toggle source
 
               # File tk/lib/tk.rb, line 2359
def encoding_names
  TkComm.simplelist(Tk.tk_call('encoding', 'names'))
end
            
encoding_system() click to toggle source
 
               # File tk/lib/tk.rb, line 2363
def encoding_system
  Tk.tk_call('encoding', 'system')
end
            
encoding_system=(enc) click to toggle source
 
               # File tk/lib/tk.rb, line 2367
def encoding_system=(enc)
  Tk.tk_call('encoding', 'system', enc)
end