Well, protobuf-net certainly includes them (it just does a simple UTF-8
conversion, nothing more), and I'm pretty sure the C++ side will be
handling them fine.

My guess would be that they are being lost in your code with whatever file
/ network handling you have in place. In particular, any code that treats
the files as text rather than binary, or does automatic line ending
conversions (which again, is text-based). Another guess would be that the
two machines have different line-ending expectations, and simply: they are
**there**, but aren't showing. I might expect this when loading a linux
file on Windows, for example.

Marc

On 8 March 2012 01:00, rui <[email protected]> wrote:

> Hi,
> I am having problem deserializing messages on c++ side
>
> From c#, i do this:
>
>  using (MemoryStream ms = new MemoryStream())
>             {
>                Serializer.Serialize(ms, instance);
>
>                return ms.ToArray();
>             }
>
> This is the class for instance parameter in protocol buffer.
> message init_message
> {
>    optional string subject = 1;
>    optional string html_body = 2;
>    optional string plain_body = 3;
> }
>
> on c++ side, i do, where msg is the byte array passed
> entity.ParseFromArray(msg.get_data(), msg.data_length);
>
> but it somehow drops all the line feeds and carriage returns \r\n in the
> transition for all the member variables.
>
> What could be the reason?
>
> Thanks,
> rui
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/protobuf/-/jen3HyN2pIQJ.
> 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.
>



-- 
Regards,

Marc

-- 
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