[ 
https://issues.apache.org/jira/browse/JSPWIKI-1052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Harry Metske closed JSPWIKI-1052.
---------------------------------
    Resolution: Duplicate
      Assignee: Harry Metske

I think this is a dup of JSPWIKI-1036.

If not, feel free to re-open the issue.

> 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
>            Assignee: Harry Metske
>            Priority: Minor
>              Labels: ajax, encoding, utf-8
>
> 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