You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_markupbuilder.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/builder-3.2.3/test
    
    the code of the file until where you have to start completion: #!/usr/bin/env ruby

#--
# Portions copyright 2004 by Jim Weirich (jim@weirichhouse.org).
# Portions copyright 2005 by Sam Ruby (rubys@intertwingl
    
    def encode string, encoding
      if !String.method_defined?(:encode)
        $KCODE = encoding
        string
      elsif encoding == 'UTF8'
        string.force_encoding('UTF-8')
      else
        string
      end