oh sorry for the confusion, when i change it to byte, its not giving
the error, but the value is gibberish which contains some special
characters and values of 2-3 fields together.
I don't know what the problem is but I found the solution, here is
what I am doing:
I searched online and read some python docs and then I wrote another
python script and processing each protobuf data like:
t = Title()
t.ParseFromString(title_str_pb)
t.title = t.title.encode('utf-8')
t.description = t.description.encode('utf-8')
t.isbn = t.isbn.encode('utf-8')
...
...
and then writing it back to my database
title_str_pb = t.SerializeToString()
and now when I open it in c++, its not giving any error.
So, I think when I was adding the original data, I should have
called .encode('utf-8') on all the python strings.
Is there anything I am missing, or easy way to do it.
On Mar 20, 11:38 pm, Kenton Varda <
ken...@google.com> wrote:
> If you changed all the "string" types to "bytes" instead, then you should
> not see that error. Are you sure you did that? If so, can you write a
> small demo program which produces this error, even when the protobuf type
> contains no "string" fields, and send it to me?
>