6bf4b8e8 by Adam Heath

Fix some encoding issues, everything is now UTF-8.

Refs: #7877
1 parent 1696b6ea
......@@ -320,7 +320,7 @@ public class DirectControlServlet extends HttpServlet {
if ("application/json".equals(contentType)) {
// Read request body as JSON and insert into the context
Map<String, Object> items = UtilGenerics.cast(JSON.from(UtilIO.readString(new FileReader(tmpFile))).toObject(Map.class));
Map<String, Object> items = UtilGenerics.cast(JSON.from(UtilIO.readString(new InputStreamReader(new FileInputStream(tmpFile), "UTF-8"))).toObject(Map.class));
for (Object key : items.keySet()) {
context.put((String) key, items.get(key));
}
......@@ -464,12 +464,12 @@ public class DirectControlServlet extends HttpServlet {
setResponseNoCache();
if ("JSON".equals(outputHandler)) {
response.setContentType("application/x-json");
response.setContentType("application/x-json;charset=UTF-8");
PrintWriter writer = response.getWriter();
String jsonStr = JSON.from(result).toString();
response.setContentLength(jsonStr.getBytes("UTF8").length);
response.setContentLength(jsonStr.getBytes("UTF-8").length);
writer.write(jsonStr);
writer.flush();
writer.close();
......