def encoding=(enc)
      return unless super
      @line_break = encode( '>' )
      if enc != UTF_8
        @buffer = decode(@buffer)
        @to_utf = true
      else
        @to_utf = false
        if @buffer.respond_to? :force_encoding
          @buffer.force_encoding Encoding::UTF_8
        end
      end
    end
def encoding=(enc)
      return unless super
      @line_break = encode( '>' )
      if enc != UTF_8
        @buffer = decode(@buffer)
        @to_utf = true
      else
        @to_utf = false
        if @buffer.respond_to? :force_encoding
          @buffer.force_encoding Encoding::UTF_8
        end
      end
    end
Constructor
 @param arg must be a String, and should be a valid XML document
 @param encoding if non-null, sets the encoding of the source to this
 value, overriding all encoding detection
 Inherited from Encoding
 Overridden to support optimized en/decoding