# File lib/haml/util.rb, line 158
      def check_haml_encoding(str, &block)
        str = str.dup if str.frozen?

        bom, encoding = parse_haml_magic_comment(str)
        if encoding; str.force_encoding(encoding)
        elsif bom; str.force_encoding("UTF-8")
        end

        return check_encoding(str, &block)
      end