module RDoc::Encoding

def self.detect_encoding string

def self.detect_encoding string
  result = HEADER_REGEXP.match string
  name = result && result[:name]
  name ? Encoding.find(name) : nil
end