import json


def jsonify(value):
    """
    Convert a value into a JSON string that can be used for JSONB queries in
    Postgres.

    If a string happens to contain the character U+0000, which cannot be
    represented in a PostgreSQL value, remove the escape sequence representing
    that character, effectively stripping out that character from all strings.
    """
    return json.dumps(value, ensure_ascii=False).replace("\\u0000", "")