Re: [protobuf] question about SerializeToString output for cpp

2010-06-11 Thread Jason Hsueh
Yes, '\0' may appear in the binary format. output->size() will return the correct result: C++ string can store null characters without any issue. However, strlen(output->c_str()) and other calls that assume null-terminated C strings will not. On Thu, Jun 10, 2010 at 11:30 PM, mistlike wrote: > b

[protobuf] question about SerializeToString output for cpp

2010-06-11 Thread mistlike
bool SerializeToString(string* output) const;: serializes the message and stores the bytes in the given string. Note that the bytes are binary, not text; we only use the string class as a convenient container. string output store binary data, and whether has "\0" in output string? such as if i wa