What's your code snippet for serializing and parsing? The 0 enum value ends up getting encoded as the null character: assuming this is in C++, I'd guess that you're using some c-style string routines that are prematurely terminating the string at the null character.
On Tue, Sep 13, 2011 at 1:39 AM, Michael Videlgauz <[email protected]>wrote: > I have a message definition with enum type and field in it. When my > application sets this field to value that is equal to 0 the ENTIRE > message arrives to receiver (after serialization and de-serialization) > with ALL fields reset (all integers are 0-s and strings are empty) > > Is it a bug in serialization/deserialization or zero is not allowed as > numeric enum value? The documentation (http://code.google.com/apis/ > protocolbuffers/docs/proto.html#enum) shows example where 0 is used as > numeric value inside enum (UNIVERSAL): > > > enum Corpus { > UNIVERSAL = 0; > WEB = 1; > IMAGES = 2; > LOCAL = 3; > NEWS = 4; > PRODUCTS = 5; > VIDEO = 6; > } > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
