This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/apisix-java-plugin-runner.git


The following commit(s) were added to refs/heads/main by this push:
     new bcf2ce3  fix: support chinese encoding in the response body (#53)
bcf2ce3 is described below

commit bcf2ce31971731d32509307485962a23654ef6ce
Author: barry <[email protected]>
AuthorDate: Sat Jul 24 10:18:55 2021 +0800

    fix: support chinese encoding in the response body (#53)
    
    Co-authored-by: chenyibing <[email protected]>
---
 .../src/main/java/org/apache/apisix/plugin/runner/HttpResponse.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/HttpResponse.java
 
b/runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/HttpResponse.java
index 1f0a876..916f748 100644
--- 
a/runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/HttpResponse.java
+++ 
b/runner-plugin-sdk/src/main/java/org/apache/apisix/plugin/runner/HttpResponse.java
@@ -187,7 +187,7 @@ public class HttpResponse implements A6Response {
 
         int bodyIndex = -1;
         if (StringUtils.hasText(body)) {
-            byte[] bodyBytes = body.getBytes(StandardCharsets.US_ASCII);
+            byte[] bodyBytes = body.getBytes(StandardCharsets.UTF_8);
             bodyIndex = Stop.createBodyVector(builder, bodyBytes);
         }
 

Reply via email to