New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Serialization/Deserialization not compatible with google's protobuf #476
Comments
Hi; that seems ... unlikely. Just so I start looking at the right place - what library version are you using? Also: are you sure that this isn't some kind of over-allocation API nuance in the C++ API, or an incorrect API usage? If I run your example code, I get 10 bytes in my "data.out" file, which is exactly what I would expect:
Equally, the second byte (the length prefix of the text) is: 0x04 - which is simply decoded as the literal value 4. The actual payload I get is: (0x) 0A-04-54-65-73-74-10-78-18-78 So: whatever is happening - I don't think it is the encode at fault here. The file you are processing: is that also 10 bytes? I'm trying to think how it might have been damaged; the most common cause is people using text APIs on binary data, but nothing in the question suggests that. |
Thank you for the insanely fast response. My payload is 11 bytes. 0A-04-54-65-73-74-10-78-18-78-0a. Super odd. I don't know where it comes from, but I would not expect the trailing I'm using protobuf.net 2.4.0, libprotoc 3.6.1, dotnet core 2.1.403 on arch linux. |
I've created an issue with protobuf - maybe they can help. Thanks again! |
We've tracked the issue down and it's related to exported symbols from a 3rd party library. Thanks for your help! |
Thanks for the update - appreciated
…On Tue, 4 Dec 2018, 07:07 Emanuel Jöbstl ***@***.*** wrote:
Closed #476 <#476>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#476 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABDsD_oPOW7QFIr3dT7PLD_ND4Lyvcgks5u1h8hgaJpZM4Y1Tmj>
.
|
When I encode my data using protobuf-net, and I try to decode it using google's protobuf for c++, strings get decoded incorrectly.
Mininal Example to reproduce
C# Program:
Then, compile
data_format.proto
using protoc.C++ Program:
Expected Output
Actual Output
The length of the deserialized string is given as
48
, which should be 4.The text was updated successfully, but these errors were encountered: