lib/remote_table/file.rb in remote_table-0.2.4 vs lib/remote_table/file.rb in remote_table-0.2.5

- old
+ new

@@ -23,11 +23,11 @@ end class << self # http://santanatechnotes.blogspot.com/2005/12/matching-iso-8859-1-strings-with-ruby.html def convert_to_utf8(str, encoding) - if encoding == 'UTF-8' + if encoding == 'UTF-8' or encoding == 'UTF8' str.toutf8 # just in case else @_iconv ||= Hash.new @_iconv[encoding] ||= Iconv.new 'UTF-8', encoding @_iconv[encoding].iconv(str).toutf8 @@ -71,11 +71,11 @@ `cat #{path} | tail -n +#{skip + 1} > #{path}.tmp` FileUtils.mv "#{path}.tmp", path end def convert_file_to_utf8! - return if encoding == 'UTF8' or encoding == 'UTF-8' - `iconv -c -f #{encoding} -t UTF8 #{path} > #{path}.tmp` + return if encoding == 'UTF-8' or encoding == 'UTF8' + `iconv -c -f #{encoding} -t UTF-8 #{path} > #{path}.tmp` FileUtils.mv "#{path}.tmp", path end def restore_file! FileUtils.mv "#{path}.backup", path if ::File.readable? "#{path}.backup"