module Regexp::Scanner

def self.emit_literal

using the total start (ts) and end (te) offsets of the run.
Emits the literal run collected by calls to the append_literal method,
def self.emit_literal
  ts, te = @literal.first[1], @literal.last[2]
  text = @literal.map {|t| t[0]}.join
  text.force_encoding('utf-8') if text.respond_to?(:force_encoding)
  @literal = nil
  emit(:literal, :literal, text, ts, te)
end