WW-3519 Added encoding type to prevent encoding errors

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1055126 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maurizio Cucchiara
2011-01-04 18:14:46 +00:00
parent 2b9aa180aa
commit 9515fa8b19
@@ -171,7 +171,7 @@ public class JSONUtil {
public static Object deserialize(Reader reader) throws JSONException {
// read content
BufferedReader bufferReader = new BufferedReader(reader);
String line = null;
String line;
StringBuilder buffer = new StringBuilder();
try {
@@ -234,7 +234,7 @@ public class JSONUtil {
InputStream in = null;
try {
out = new GZIPOutputStream(response.getOutputStream());
in = new ByteArrayInputStream(json.getBytes());
in = new ByteArrayInputStream(json.getBytes(serializationParams.getEncoding()));
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {