class RDoc::Comment

def encode! encoding

def encode! encoding
  # TODO: Remove this condition after Ruby 2.2 EOL
  if RUBY_VERSION < '2.3.0'
    @text = @text.force_encoding encoding
  else
    @text = String.new @text, encoding: encoding
  end
  self
end