Thank you for pointing out the fact that encoded message may contain
null character!
I do not think it may be the problem because I am using only
std::string, SerializeToString() and never use string::c_str() to
manipulate with encoded buffers.
0MQ is used as network to transport those encoded strings.

But I'll still double check the entire flow again and come back to
thread soon...

On Sep 13, 9:48 pm, Jason Hsueh <[email protected]> wrote:
> 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.

Reply via email to