grpc-node
grpc-node copied to clipboard
error details of the chinese will be will be truncated, a chinese charactor is three bytes
Problem description
error details of the chinese will be will be truncated
Reproduction steps
in service.js
function sayHello(call, callback) {
callback({
code: grpc.status.NOT_FOUND,
details: '你好啊世界'
});
}
client.js
client.sayHello({name: user}, function (err, response) {
if (err) {
console.log(err.details);
} else {
console.log('Greeting:', response.message);
}
});
this client.js will print :
$ node greeter_client.js
(node:15552) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module wi
th grpc.loadPackageDefinition instead
你�
Environment
- node v8.9.1
- [email protected]
Additional context
a chinese charactor is three bytes