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 ...
随机推荐
- C#Project不生成.vhost.exe和.pdb文件的方法
编译C#工程时,在C#的Project的属性界面的Build选项卡中当Configuration : Relese 时,依然会生成扩展名为.vhost.exe和.pdb文件. 其中.pdb是debug ...
- xcode7 断点失效
今天下了个别人的demo,运行发现断点不起作用,开始以为是xcode7的问题,因为自升级到xcode7后没怎么用,但后来尝试其它项目,发现是可以断点的,所以才认定不是xcode的问题,而是项目配置的问 ...
- xib autolayout subview
http://sebastiancelis.com/2014/06/12/using-xibs-layout-custom-views/ initWitchCoder 有点小问题
- excel weekday
weekday(日期值)=星期几 星期天是1 星期六是7
- atitit.nfc 身份证 银行卡 芯片卡 解决方案 attilax总结
atitit.nfc 身份证 银行卡 芯片卡 解决方案 attilax总结 1. nfc(近距离无线通讯技术) 1 2. 工作模式 1 3. NFC 蓝牙 红外具体对比如下表: 2 4. TypeA ...
- VS编译duilib项目时候的错误解决方法整理
@1:找不到Riched20.lib 用everything等软件搜索下磁盘.找到所在的文件夹加入到vs的库文件夹就可以.我得是C:\Program Files (x86)\Microsoft SDK ...
- python学习之sys模块
查看python的版本 >>> sys.version_info[] sys.argv 列表对象,传入模块参数的都会放入列表中. #-*- coding: utf-8 -*- # i ...
- poj Squares n个点,共能组成多少个正方形 二分 + 哈希
题目链接:http://poj.org/problem?id=2002 测试数据: 41 00 11 10 090 01 02 00 21 22 20 11 12 14-2 53 70 05 20 有 ...
- sitemesh 2.4 装饰器学习
SiteMesh 是一个网页布局和修饰的框架,利用它可以将网页的内容和页面结构分离,以达到页面结构共享的目的 SiteMesh是OpenSymphony团队开发的JEE框架之一,它是一个非常优秀的页面 ...
- 1.2.1 Fragments - 碎片
在activity中,Fragment代表了一种行为和用户界面的一部分.在一个activity里,你可以联合多个fragment来创建一个多面板的UI,你也可以在多个activity里重复使用同一个f ...