From d52e2c04a6360eaa0016fd6e0da47a7ed7d9eceb Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 3 Feb 2013 12:51:12 -0300 Subject: [PATCH] Fix encoding on returning maps. --- .../main/java/com/wisemapping/rest/MindmapController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index daa81038..df1b8da1 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -175,10 +175,11 @@ public class MindmapController extends BaseController { @RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/document/xml",consumes = {"text/plain"}, produces = {"application/xml"}) @ResponseBody - public String retrieveDocument(@PathVariable int id, @NotNull HttpServletResponse response) throws WiseMappingException, IOException { + public byte[] retrieveDocument(@PathVariable int id, @NotNull HttpServletResponse response) throws WiseMappingException, IOException { + // I should not return byte, but there is some encoding issue here. Further research needed. response.setCharacterEncoding("UTF-8"); final Mindmap mindmap = mindmapService.findMindmapById(id); - return mindmap.getXmlStr(); + return mindmap.getXmlStr().getBytes("UTF-8"); }