Imported from previous forum
Section 10.6.3 discusses a zero-preamble for ASCII strings. There is a table provided with examples, which seem to differ from examples provided in Appendix 3.1.3. For instance a NULL string is 0x00 in 10.6.3, but 0x80 in 3.1.3. An empty nullable string is 0x00 0x00 in 10.6.3 but 0x00 0x80 in 3.1.3. Which examples are correct?
Also from 10.6.3 how is it possible to destinguish 0x00 0x00 from a non-nullable empty string followed by the beginning of an Int32 or a non-nullable string containing “\0”?
If possible, please shed more light on the purpose and use of the zero-preamble as apart from detecting(why?) overlong strings, it doesn’t seem to enable additional representations that could be made without it.
Thanks,
Robin Nicholson
The purpose of the zero-preamble is precicely to distinguish from the empty string, NULL, and a string starting with ‘\0’. The purpose is not to detect overlong strings. In fact, overlong strings, as defined, are an artifact of the use of zero preambles.
The overlong rule is there to ensure that there is exactly one single way of correctly encoding any particular string.
The reason the examples differ from the table in 10.6.3 is that in the examples the stop bit is shown. The table in 10.6.3 lists the bit patterns of the entity values. The entity value of a stop bit encoded entity is the bits that remain after the stop bits have been removed.
/David
Section 10.6.3 discusses a zero-preamble for ASCII strings. There is a
table provided with examples, which seem to differ from examples
provided in Appendix 3.1.3. For instance a NULL string is 0x00 in
10.6.3, but 0x80 in 3.1.3. An empty nullable string is 0x00 0x00 in
10.6.3 but 0x00 0x80 in 3.1.3. Which examples are correct?Also from 10.6.3 how is it possible to destinguish 0x00 0x00 from a non-
nullable empty string followed by the beginning of an Int32 or a non-
nullable string containing “\0”?If possible, please shed more light on the purpose and use of the zero-
preamble as apart from detecting(why?) overlong strings, it doesn’t seem
to enable additional representations that could be made without it.Thanks, Robin Nicholson