def Dump(obj,
         sort_keys = False,
         encoder = None):
  text = json.dumps(
      obj,
      indent=2,
      sort_keys=sort_keys,
      ensure_ascii=False,
      cls=encoder,
      separators=_SEPARATORS)
  if compatibility.PY2 and isinstance(text, bytes):
    text = text.decode("utf-8")
  return text