Re: [protobuf] Use different encoding while serializing strings

2014-05-15 Thread Marc Gravell
protobuf is a binary-safe protocol, and is not impacted by contents such as \r, \n or \t. In particular, text content is utf-8 encoded and length-prefixed - it simply *does not care* what is inside the text. I suspect any problem you are having relates to how you are transporting and processing

[protobuf] Re: Use different encoding while serializing strings

2014-05-15 Thread Ganesh Sangle
Here is an example: Serialized message: ' \x12%/storage-array-action-add\x1a\r\n\x08username\x12\x01g\x1a\r\n \x08password\x12\x01p\x1a\x0e\n\x04type\x12\x06NetApp\x1a\t\n\x04name\x12\x01a\x1a\n\n\x04port\x12\x0280' As you can see the highlighted text is added by protobuf (Which i assume are

Re: [protobuf] Use different encoding while serializing strings

2014-05-15 Thread Ilia Mirkin
protobuf does not use \r or \n for any specific purposes. It does, however, assume that it can use any byte it chooses. There is no way to restrict that. You would have to create a protocol to encode arbitrary bytes over your not-binary-safe-channel, which would have to create a way to escape \r

Re: [protobuf] Use different encoding while serializing strings

2014-05-15 Thread Oliver Jowett
The primary protobuf serialization format is the binary format, not the text format. Is there some reason you can't use the binary form? Oliver On 15 May 2014 18:33, Ganesh Sangle saygane...@gmail.com wrote: Let me clarify the question. 1. I did not say that protobuf is affected by \r\n. 2.

[protobuf] Re: Use different encoding while serializing strings

2014-05-15 Thread Ganesh Sangle
Ok, Thanks all for your explanation. I encoded the protobuf serialized string to base64 so I can work now. The reason this may seem weird is that I am using protobuf over a text channel and not a binary channel - the reason is same, i have to pass some compound data structure from one process