class Unparser::Emitter::String

Base class for primitive emitters

def dispatch

def dispatch
  if explicit_encoding && !value.encoding.equal?(explicit_encoding)
    write_utf8_escaped
  else
    write(value.inspect)
  end
end

def write_utf8_escaped

def write_utf8_escaped
  write('"')
  value.each_codepoint do |codepoint|
    write("\\u{#{codepoint.to_s(16)}}")
  end
  write('"')
end