class Tilt::Template

def extract_magic_comment(script)

def extract_magic_comment(script)
  comment = script.slice(/\A[ \t]*\#.*coding\s*[=:]\s*([[:alnum:]\-_]+).*$/)
  return comment if comment and not %w[ascii-8bit binary].include?($1.downcase)
  "# coding: #{@default_encoding}" if @default_encoding
end