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

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git


The following commit(s) were added to refs/heads/master by this push:
     new eb64b9dc4e AXIS2-5964 AbstractJSONMessageFormatter NOT using 
CharSetEncoding when reding Json string Bytes
eb64b9dc4e is described below

commit eb64b9dc4ed659880bcba5b278c2c6765d8995c1
Author: Robert Lazarski <robertlazar...@gmail.com>
AuthorDate: Mon Nov 11 15:21:29 2024 -1000

    AXIS2-5964 AbstractJSONMessageFormatter NOT using CharSetEncoding when 
reding Json string Bytes
---
 .../json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java 
b/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
index afce0f6938..b09acfff4c 100644
--- a/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
+++ b/modules/json/src/org/apache/axis2/json/AbstractJSONMessageFormatter.java
@@ -135,9 +135,8 @@ public abstract class AbstractJSONMessageFormatter 
implements MessageFormatter {
             }
             String jsonToWrite = getStringToWrite(element);
             if (jsonToWrite != null) {
-                String encoding = format.getCharSetEncoding();
-                if (encoding != null) {
-                    out.write(jsonToWrite.getBytes(encoding));
+                if (format != null && format.getCharSetEncoding() != null) {
+                    
out.write(jsonToWrite.getBytes(format.getCharSetEncoding()));
                 } else {
                     out.write(jsonToWrite.getBytes());
                }

Reply via email to