3 ms·
What is the FIDL "string" type? Please someone tell me they've learned from the decades of C/C++ gotchas and not made them arbitrary-length null-terminated seq
by AceJohnny2 5y ago
What is the FIDL "string" type?
Please someone tell me they've learned from the decades of C/C++ gotchas and not made them arbitrary-length null-terminated sequences of bytes...
- surajrmal 5y agoThey are variable length utf-8 encoded character sequences with a specified length. They are notably not null terminated: https://fuchsia.dev/fuchsia-src/reference/fidl/language/language?hl=en#strings https://fuchsia.dev/fuchsia-src/reference/fidl/language/lang...
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- pjmlp 5y agoCOM already learned that lesson 25 years ago, they have a length field + null terminator for easily giving them directly to C like APIs, and they needed to provide easy interop between VB and C++. However I wouldn't advise doing that direcly unless you trust the callee.