string optional delta operator

Imported from previous forum

[ original email was from Thomas Schultz - tschultz@lind-waldock.com ]
Since the optional delta operator is nullable, if the substraction length is not null, is the string that follows also handled as a nullable string? It makes sense that at times an empty string is what would be desired, allowing the base value string to be cut off at the front or back. I could not find where the specification addressed this question. I’m wondering about these two cases:

A. stream input:(0)0000000 (1)0000000 (not nullable assumption) is the “\0” string
B. stream input:(0)0000000 (1)0000000 (nullable assumption) is the empty string.

Only the subtraction length is nullable in a nullable string delta. So the empty string that follows the length preamble in this case should be encoded as single 0x80. You can find more information about empty strings in the table in section 10.6.3 of the specification.

/David

Since the optional delta operator is nullable, if the substraction
length is not null, is the string that follows also handled as a
nullable string? It makes sense that at times an empty string is what
would be desired, allowing the base value string to be cut off at the
front or back. I could not find where the specification addressed this
question. I’m wondering about these two cases:

A. stream input:(0)0000000 (1)0000000 (not nullable assumption) is the
“\0” string B. stream input:(0)0000000 (1)0000000 (nullable assumption)
is the empty string.

Oops, typo, should have read “subtraction length” where I wrote “length preamble”. /David

Only the subtraction length is nullable in a nullable string delta. So
the empty string that follows the length preamble in this case should be
encoded as single 0x80. You can find more information about empty
strings in the table in section 10.6.3 of the specification.

/David

Since the optional delta operator is nullable, if the substraction
length is not null, is the string that follows also handled as a
nullable string? It makes sense that at times an empty string is what
would be desired, allowing the base value string to be cut off at the
front or back. I could not find where the specification addressed this
question. I’m wondering about these two cases:

A. stream input:(0)0000000 (1)0000000 (not nullable assumption) is the
“\0” string B. stream input:(0)0000000 (1)0000000 (nullable
assumption) is the empty string.