Fix encoding on returning maps.

This commit is contained in:
Paulo Gustavo Veiga 2013-02-03 12:51:12 -03:00
parent edc3351fd8
commit d52e2c04a6

View File

@ -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");
}