def _get_string(data, view, position, obj_end, opts, dummy):
    """Decode a BSON string to python unicode string."""
    length = _UNPACK_INT_FROM(data, position)[0]
    position += 4
    if length < 1 or obj_end - position < length:
        raise InvalidBSON("invalid string length")
    end = position + length - 1
    if data[end] != _OBJEND:
        raise InvalidBSON("invalid end of string")
    return _utf_8_decode(view[position:end],
                         opts.unicode_decode_error_handler, True)[0], end + 1
Decode a BSON string to python unicode string.
stackoverflow/venv/lib/python3.6/site-packages/bson/__init__.py