You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/08 13:48:58 UTC

[GitHub] [apisix-java-plugin-runner] dargoner commented on issue #154: bug: POST request with body contain chinese characters exist encoding problem

dargoner commented on issue #154:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/154#issuecomment-1272324758

   > @tzssangglass
   > 
   > I mean body in request, fixed by modifing ExtraInfoResponse.getResult:
   > 
   > from:
   > 
   > ```
   > public String getResult() {
   >       StringBuilder builder = new StringBuilder();
   >        for (int i = 0; i < this.resp.resultLength(); i++) {
   >             builder.append((char) this.resp.result(i));
   >        }
   >        return builder.toString();
   >     }
   > ```
   > 
   > to
   > 
   > ```
   > public String getResult() {
   >         byte[] bytes = new byte[this.resp.resultLength()];
   >         for (int i = 0; i < this.resp.resultLength(); i++) {
   >             bytes[i] = (byte) this.resp.result(i);
   >         }
   >         return new String(bytes, StandardCharsets.UTF_8);
   >     }
   > ```
   
   确实有个问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org