通过client jdbc链接server sql语句中的中文会乱码
bimengnan opened this issue · 2 comments
bimengnan commented
执行sql select * from table where name ="张三" 表里有数据却查不到,在server源码中增加代码打印sql语句发现 中文变为了??,es、oracle 都发现这个问题。
ckgiant commented
默认字符为ISO-8859-1,request请求时设置一下为UTF-8即可
org.apache.calcite.avatica.remote.RemoteService
byte[] response = this.client.send(request.getBytes(StandardCharsets.UTF_8));
改为
byte[] response = this.client.send(new String(request.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1).getBytes());
fangyuefy commented
这个是calcite avatica的bug,升级 avatica版本到1.17.0,问题解决。