3 ms·
It's unfortunate that in 2013, we're still developing protocols and formats that have weird Unicode support. Cap'n Proto only seems to support Modified UTF-8, w
by tomp 14y ago
It's unfortunate that in 2013, we're still developing protocols and formats that have weird Unicode support. Cap'n Proto only seems to support Modified UTF-8, which doesn't include NULL bytes[1]. Though I believe support for full UTF-8 would be a trivial change, requiring no changes to code.
[1] http://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8 http://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8
- kentonv 14y agoYou're right. Someone brought this up on the mailing list, and I agreed that the no-NUL-in-content restriction could be dropped. A NUL byte will still be required at the end, and it will be up to apps to decide if they want to add further restrictions.
- tomp 14y agoI agree with ending null bytes. It eases cross-language compatibility, and it usually costs nothing because it fits into the padding bytes anyway. Btw, that's exactly what OCaml does (string have length, can include nulls, but still end with null bytes, to be passable to C functions).