Commit 8ac9494c authored by Kenton Varda's avatar Kenton Varda

Relax restriction that text can't contain NUL characters.

parent a6aa9d6a
...@@ -55,10 +55,13 @@ from C++, where the `bool` type takes a whole byte. ...@@ -55,10 +55,13 @@ from C++, where the `bool` type takes a whole byte.
The built-in blob types are encoded as follows: The built-in blob types are encoded as follows:
* `Data`: Encoded as a pointer, identical to `List(UInt8)`. * `Data`: Encoded as a pointer, identical to `List(UInt8)`.
* `Text`: Like `Data`, but the content must be valid UTF-8, the last byte of the content must be * `Text`: Like `Data`, but the content must be valid UTF-8, and the last byte of the content must
zero, and no other byte of the content can be zero. Note that the NUL terminator is included in be zero. The encoding allows bytes other than the last to be zero, but some applications
the size sent on the wire, but the runtime library should not count it in any size reported to (especially ones written in languages that use NUL-terminated strings) may truncate at the first
the application. zero. If a particular text field is explicitly intended to support zero bytes, it should
document this, but otherwise senders should assume that zero bytes are not allowed to be safe.
Note that the NUL terminator is included in the size sent on the wire, but the runtime library
should not count it in any size reported to the application.
## Enums ## Enums
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment