summaryrefslogtreecommitdiff
path: root/redis/commands/search/_util.py
blob: dd1dff33dd336c58f6616b4e5ccac9cf20b34866 (plain)
1
2
3
4
5
6
7
def to_string(s):
    if isinstance(s, str):
        return s
    elif isinstance(s, bytes):
        return s.decode("utf-8", "ignore")
    else:
        return s  # Not a string we care about