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 ...
随机推荐
- 点滴积累【JS】---JS小功能(checkbox实现全选和全取消)
效果: 代码: <head runat="server"> <title></title> <script type="text ...
- 解决Ubuntu下博通网卡驱动问题
sudo apt-get install bcmwl-kernel-source我的无线网卡是BCM4312 802.11b/g 在12.04 会集成驱动,装完就能用,现在用14.04,16.04里面 ...
- Java小型知识点
1. API 1.1 byte[].File.InputStream 互相转换 1.将File.FileInputStream 转换为byte数组: File file = new File(&quo ...
- Android收起虚拟键盘
关于收起虚拟键盘,网上能找到的大多是这个: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_M ...
- 如何查看iis的连接数量
引用:http://jingyan.baidu.com/article/54b6b9c0f3c2002d583b470d.html 运行,输入,perfmon.msc. 在系统监视器,区域点击,添 ...
- linux TZ格式
man tzset可以很清楚了解时区设置格式,共3种: The first format is used when there is no daylight saving time in the lo ...
- 我不会OOO,仍然可以XXX_转
转自:http://blog.csdn.net/absurd 按照<审死官>里的读法,标题可以读着:答复:我不会圈圈圈,仍然可以叉叉叉.圈圈叉叉并不特指某个东西,而是一个通配符.代表诸如: ...
- java.lang.NoSuchMethodError: org.apache.spark.util.ThreadUtils$.newDae
-classpath "C:\Program Files\Java\jdk1.8.0_131\jre\lib\charsets.jar;C:\Program Files\Java\jdk1. ...
- Buffer ByteBuffer 缓冲区
http://blog.sina.com.cn/s/blog_4150f50c0100gfa3.html
- Python 使用标准库根据进程名获取进程PID
应用场景 在进行 Linux 运维的环境中,我们经常会遇到维护同一台服务器上的多个程序,涉及到程序的启动.关闭和重启操作. 通常这些程序之间存在着相互依存的关系需要进行依次的启动关闭操作. 下面介绍几 ...