invalid UTF-8 data when parsing a protocol buffer, and about -DNDEBUG

2,298 views
Skip to first unread message

Lin Lu

unread,
Aug 15, 2014, 4:02:52 AM8/15/14
to prot...@googlegroups.com
Hi,
I have some questions about the protocol buffer.
We got an error message when parsing data from a website:
"[libprotobuf Error, google/protobuf/wire_format.cc:1053]
String field contains invalid UTF-8 data when parsing a protocol buffer.
Use the 'bytes' type if you intend to send raw bytes."
So we went back to check the source code of protocol buffer, and found that this check is controlled by a macro(-DNDEBUG: it means NOT debug mode?, according to the comment). And -DNDEBUG disables GOOGLE_PROTOBUF_UTF8_VALIDATION(i think?). So, we enabled this macro(-DNDEBUG) in the configuration. However, after testing, we still got the same error message. And then, we changed all the "String" type to "Bytes" typr in XXX.proto. After testing, the same error message showed, and "core dump", then the process died. Hope somebody can help us solving this problem.
Thank you




Lin
Reply all
Reply to author
Forward
0 new messages