(data, position, obj_end, opts, dummy)
return _utf_8_decode(data[position:end],
                         opts.unicode_decode_error_handler, True)[0], end + 1
Decode a BSON string to python unicode string.
Decode a BSON string to python unicode string.
Decode a BSON string to python unicode string .
def _get_string(data, position, obj_end, opts, dummy):
    """Decode a BSON string to python unicode string."""
    length = _UNPACK_INT(data[position:position + 4])[0]
    position += 4
    if length < 1 or obj_end - position < length:
        raise InvalidBSON("invalid string length")
    end = position + length - 1
    if data[end:end + 1] != b"\x00":
        raise InvalidBSON("invalid end of string")
    return _utf_8_decode(data[position:end],
                         opts.unicode_decode_error_handler, True)[0], end + 1
def _get_string ( data , position , obj_end , opts , dummy ) : length = _UNPACK_INT ( data [ position : position + 4 ] ) [ 0 ] position += 4 if length < 1 or obj_end - position < length : raise InvalidBSON ( "invalid string length" ) end = position + length - 1 if data [ end : end + 1 ] != b"\x00" : raise InvalidBSON ( "invalid end of string" ) return _utf_8_decode ( data [ position : end ] , opts . unicode_decode_error_handler , True ) [ 0 ] , end + 1