method

meta_setup_encoding

Importance_0
meta_setup_encoding() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/open-uri.rb, line 463
    def meta_setup_encoding # :nodoc:
      charset = self.charset
      enc = nil
      if charset
        begin
          enc = Encoding.find(charset)
        rescue ArgumentError
        end
      end
      enc = Encoding::ASCII_8BIT unless enc
      if self.respond_to? :force_encoding
        self.force_encoding(enc)
      elsif self.respond_to? :string
        self.string.force_encoding(enc)
      else # Tempfile
        self.set_encoding enc
      end
    end
Register or log in to add new notes.