macchina001
macchina001

Reputation: 3

Protobuf message from CPP to python

I have define my protobuf message that is serialize in CPP and send to Python program thank to a wrapper. On CPP side, the protobuf message is generate as std::string

Here is how I generate in cpp my message:

  ....
  std::string data = results.SerializeAsString();
  return data;

In Python, I just connect my CPP wrapper and I try to get the string message. With a common message, the communication between CPP and Python works properly but with the protobuf serialized message, I get that error:

'utf-8' codec can't decode byte 0xff in position 13: invalid start byte

Is there a way to encore in CPP the string message to be readable in Python?

Upvotes: 0

Views: 113

Answers (0)

Related Questions