Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
avatica-1.11.0, avatica-1.12.0, avatica-1.13.0
Description
When we execute SQL with Chinese characters, we find that the server parses it in gibberish.
After checking the code, we found that:
org.apache.calcite.avatica.server.AvaticaJsonHandler.java line 109:
//The readFully method USES utf-8 encoding internally.
rawRequest = AvaticaUtils.readFully(inputStream, buffer);
But in the org.apache.calcite.avatica.server.AvaticaJsonHandler.java line 116:
// Decoded using iso-8859-1 Cause Chinese garble. final String jsonRequest = new String(rawRequest.getBytes("ISO-8859-1"), "UTF-8");