def ConvertStringToFilename(name):
  return re.sub(r"\W", lambda x: "%%%02X" % ord(x.group(0)),
                name, flags=re.UNICODE).rstrip("/")
Converts an unicode string to a filesystem safe filename.
dataset/ETHPy150Open google/grr/grr/lib/data_stores/common.py/ConvertStringToFilename