Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2704

Multilingual decoded problem

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    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");
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            donnyzone Feng Zhu
            2k124 pufan
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 5h 10m
                5h 10m

                Slack

                  Issue deployment