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: encoding_fixes.rb
    path of file: ./repos/solargraph/lib/solargraph/source
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Solargraph
  class Source
    module EncodingFix
    
      def normalize string
        begin
          string.dup.force_encoding('UTF-8')
        rescue ::Encoding::CompatibilityError, ::Encoding::UndefinedConversionError, ::Encoding::InvalidByteSequenceError => e
          # @todo Improve error handling
          Solargraph::Logging.logger.warn "Normalize error: #{e.message}"
          string
        end