https://developers.google.com/protocol-buffers/docs/encoding shows that strings are length delimited. That is, an integer varint is stored, representing the length of the following string. This way the string can contain nulls, or any other character, but protobuf parser will keep reading until it reads up to length bytes.
As for the issue you are having, I don't know the answer, but perhaps showing your code would help someone spot a problem. Andrew On 20 July 2015 at 23:42, Devesh Gupta <[email protected]> wrote: > Hello, > > as per various forums it is mentioned that in serialized string can have > null character in between. > I just wanted to know how is protobuf able to find the end of the string > being passed for deserialization. > > Actually, when i am deserialization a the string it is failing. This > happens when the int32 value passed for serialization is 0. In case if we > pass any value above 0 gets de-serialized successfully, > > I have checked the serialized string characters and in case of 0 value, > there is a null character representing it. > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
