BATCH-1684: Forcing the use of ISO-8859-1 encoding for persistence
This commit is contained in:
@@ -224,14 +224,17 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
|
||||
}
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
String results = "";
|
||||
|
||||
try {
|
||||
serializer.serialize(m, out);
|
||||
results = new String(out.toByteArray(), "ISO-8859-1");
|
||||
}
|
||||
catch (IOException ioe) {
|
||||
throw new IllegalArgumentException("Could not serialize the execution context", ioe);
|
||||
}
|
||||
|
||||
return new String(out.toByteArray());
|
||||
return results;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -242,10 +245,10 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
|
||||
if (serializedContext == null) {
|
||||
serializedContext = rs.getString("SHORT_CONTEXT");
|
||||
}
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(serializedContext.getBytes());
|
||||
|
||||
Map<String, Object> map;
|
||||
try {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(serializedContext.getBytes("ISO-8859-1"));
|
||||
map = (Map<String, Object>) serializer.deserialize(in);
|
||||
}
|
||||
catch (IOException ioe) {
|
||||
|
||||
@@ -86,9 +86,9 @@ public class DefaultExecutionContextSerializerTests {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
serializer.serialize(m1, out);
|
||||
|
||||
String s = new String(out.toByteArray());
|
||||
String s = new String(out.toByteArray(), "ISO-8859-1");
|
||||
|
||||
InputStream in = new ByteArrayInputStream(s.getBytes());
|
||||
InputStream in = new ByteArrayInputStream(s.getBytes("ISO-8859-1"));
|
||||
Map<String, Object> m2 = (Map<String, Object>) serializer.deserialize(in);
|
||||
return m2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user