Varga Péter created JSPWIKI-1052:
------------------------------------

             Summary: SearchManager missing character encoding in before json 
response writing
                 Key: JSPWIKI-1052
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-1052
             Project: JSPWiki
          Issue Type: Bug
          Components: Search
    Affects Versions: 2.10.2
         Environment: linux
            Reporter: Varga Péter
            Priority: Minor


When using ajax functionality in editor to create a link to pages, 
SearchManager will not send responses encoded in accordance to the 
wikiEngine.getContentEncoding.

Proposed fix:
{code:java}
...
                String encoding = getEncoding(req);
                if (encoding != null) {
                        resp.setCharacterEncoding(encoding);
                } else {
                        resp.setCharacterEncoding("UTF-8");
                }
                log.debug("result="+result);
                resp.getWriter().write(result);
        }
        
        private String getEncoding(HttpServletRequest req) {
                String ret = null;
                WikiEngine wikiEngine = 
WikiEngine.getInstance(req.getSession().getServletContext(), null);
                ret = wikiEngine.getContentEncoding();
                        return ret;
                }
{/code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to