def _process_value(value):
    """Convert the value into a human readable diff string
    """
    if not value:
        value = _("Not set")
    # XXX: bad data, e.g. in AS Method field
    elif value == "None":
        value = _("Not set")
    # 0 is detected as the portal UID
    elif value == "0":
        pass
    elif api.is_uid(value):
        value = _get_title_or_id_from_uid(value)
    elif isinstance(value, (dict)):
        value = json.dumps(sorted(value.items()), indent=1)
    elif isinstance(value, (list, tuple)):
        value = sorted(map(_process_value, value))
        value = "; ".join(value)
    elif isinstance(value, unicode):
        value = api.safe_unicode(value).encode("utf8")
    return str(value)
Convert the value into a human readable diff string