raw_encoding(default = Encoding::ASCII_8BIT)
private
Returns the encoding of the internal IO object or
the default if the encoding cannot be determined.
# File lib/csv.rb, line 2303
def raw_encoding(default = Encoding::ASCII_8BIT)
if @io.respond_to? :internal_encoding
@io.internal_encoding || @io.external_encoding
elsif @io.is_a? StringIO
@io.string.encoding
elsif @io.respond_to? :encoding
@io.encoding
else
default
end
end