wire_format.cc:1091] String field 'accountid' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
原因:
在protobuf 的string字段中存在中文,序列化的时候会出现截断数据,string这个类型带有检查功能
解决方法:
把protobuf中存在中文的string字段类型 改为bytes
string的序列化函数多以下代码
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->strdeptname().data(), this->strdeptname().length(),
::google::protobuf::internal::WireFormat::PARSE,
"strdeptname");
wire_format.cc:1091] String field 'accountid' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.的更多相关文章
- String field contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
[libprotobuf ERROR google/protobuf/wire_format.cc:1053] String field contains invalid UTF-8 data whe ...
- mongodb 更新数组出现can't append to array using string field name
数据库内容大概如下: { _id:, "hero_list" : { " : { , , "equip" : [ [ ], [ ], [ ], { , ...
- 54.string field聚合以及fielddata原理初探
主要知识点: 直接对分词的term进行聚合后果 设置fielddata=true 直接用.keyword进行聚合 doc value 的性能问题 一.直接对分词的term进行聚合后果 ...
- 融合libevent和protobuf
写了一个简单的例子,把libevent中的bufferevent网络收发服务和protobuf里面的序列反序列结合起来. protobuf文件message.proto: message PMessa ...
- gPRC学习笔记
gPRC学习笔记 gPRC基础教程. gPRC官方文档. protobuf 3.0的简易教程. 什么是RPC RPC(remote procedure call) -- 远程过程调用(相对于本地调用的 ...
- C++开源代码项目汇总
Google的C++开源代码项目 v8 - V8 JavaScript EngineV8 是 Google 的开源 JavaScript 引擎.V8 采用 C++ 编写,可在谷歌浏览器(来自 Go ...
- 字段值为 null 时,序列化或反序列化成其他值
using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System; using System.Collections.G ...
- protocol buffer开发指南
ProtoBuf 是一套接口描述语言(IDL)和相关工具集(主要是 protoc,基于 C++ 实现),类似 Apache 的 Thrift).用户写好 .proto 描述文件,之后使用 protoc ...
- 高效的数据压缩编码方式 Protobuf
一. protocol buffers 是什么? Protocol buffers 是一种语言中立,平台无关,可扩展的序列化数据的格式,可用于通信协议,数据存储等. Protocol buffers ...
随机推荐
- javascript和html中unicode编码和字符转义的详解
1.html中的转义:在html中如果遇到转义字符(如“ ”),不管你的页面字符编码是utf-8亦或者是GB2312,都会直接打印成相应的字符:而当遇到(如:“\u8981”[此处的8981是16进制 ...
- MYSQL备份与恢复精华篇
数据备份原理 数据备份属于数据容灾保护中的内容,所有的数据备份系统设计都基于这五个元素,备份源.备份目标.传输网络.备份引擎和备份策略.用户按照需要制定备份策略,使用定时任务执行备份脚本,使用备份引擎 ...
- Java并发编程(一):并发与高并发等基础概念
并发概念 同时拥有两个或者多个线程,如果程序在单核处理器上运行,多个线程将交替地换入或者换出内存,这些线程是同时存在的,每个线程都处于执行过程中的某个状态.如果运行在多核处理器上,程序中的每个线程都将 ...
- 代码覆盖率?coverage
http://www.infoq.com/cn/articles/test-coverage-rate-role 代码覆盖率?coverage http://www.cnblogs.com/cod ...
- C# 使用IP端口网络打印图片
/// <summary> /// POSPrinter的摘要说明. /// 此类处理网络打印,使用了IP端口. /// </summary> public class Net ...
- poj Buy Tickets
题目链接:http://poj.org/problem?id=2828 类似的题目:http://www.cnblogs.com/lovychen/p/3674048.html 测试数据: in: 4 ...
- iOS9新特性
本文主要是说一些iOS9适配中出现的坑,如果只是要单纯的了解iOS9新特性可以看瞄神的开发者所需要知道的 iOS 9 SDK 新特性.9月17日凌晨,苹果给用户推送了iOS9正式版,随着有用户陆续升级 ...
- jQuery 实战读书笔记之第五章:使用 jQuery 操作页面
html 如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> &l ...
- modbus学习
- HttpClient+jsoup登录+解析 163邮箱
找了几个,只有这个靠谱,用的是httpclient4,另外还需要commons-lang和jsoup包 http://jsoup.org/ http://www.oschina.net/code/sn ...