I don't know whether I can "+1" on this issue, but if I could, I would definitely "+1" it :-) On Mon, Mar 16, 2009 at 8:23 AM, Sergiu Dumitriu <[email protected]> wrote:
Of course, this goes without saying. I wonder if this is needed at all, since -Dfile.encoding should be enough. Any specific LANG might not be available on the server (in France it is common to have just fr_FR).
I previously identified 6 areas that I hard-coded over to UTF-8. Some of these were voodoo, some of these worked-directly. I believe this part (which also started this thread) was the most relevant: to [email protected], XWiki Users <[email protected]>
date Fri, Mar 13, 2009 at 5:48 PM subject Re: [xwiki-users] [xwiki-devs] support for google sitemaps and webmaster tools? (and why do xwiki RDF's give "unsupported file format"?)
...
PS: Why not just have xwiki.cfg's default be: 'xwiki.encoding=UTF-8' ;
likewise have web.xml's default for com.xpn.xwiki.web.SetCharacterEncodingFilter's 'encoding' be UTF-8. These encoding errors that oft go unnoticed are probably resulting in a number of configuration errors, and perhaps other bug-reports that aren't entirely valid, should they depend on encoding issues.
So what exactly do these 6 areas affect (or side-efect) if set or not set? (1) -Dfile.encoding -> UTF-8
I fixed this issue by running java with -Dfile.encoding=UTF-8 (note the lowercase setting suggested in http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Performances seems incorrect?).
(2) -Djavax.servlet.request.encoding -> UTF-8
When that alone didn't work, I also added " -Djavax.servlet.request.encoding=UTF-8
(3) -DjavaEncoding -> UTF-8
-DjavaEncoding=UTF-8" which had been suggested in solving this problem for other Tomcat users. (Now I run java with the following options:-server -Xms160m -Xmx1024m -XX:PermSize=160m -XX:MaxPermSize=320m -Djavax.servlet.request.encoding= UTF-8 -Dfile.encoding=UTF-8 -DjavaEncoding=UTF-8 -Djava.awt.headless=true)
(4) LANG -> UTF-8
I also saw other suggestions to set LANG="en_US.UTF-8" in the tomcat launching script...
(5) com.xpn.xwiki.web.SetCharacterEncodingFilter's 'encoding' -> UTF-8
however, I'm not sure which of my changes "did" it, but i believe that following two steps I'd forgotten||skipped in http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Encoding caused the correct encoding to be used: (1) WEB-INF> diff web.xml.~1~ web.xml 23c23 < <param-value>ISO-8859-1</param-value> ---
<param-value>UTF-8</param-value>
(6) xwiki.encoding -> UTF-8
(2) WEB-INF> diff xwiki.cfg.~2~ xwiki.cfg 29c29 < xwiki.encoding=ISO-8859-1 ---
xwiki.encoding=UTF-8
-- Niels http://nielsmayer.com