You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Varga Péter (JIRA)" <ji...@apache.org> on 2017/02/27 10:43:45 UTC

[jira] [Created] (JSPWIKI-1052) SearchManager missing character encoding in before json response writing

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)