Wiki source code of Encoding

Version 1.16 by bitman09 on 2007/11/20

Show last authors
1 1 XWiki Character Encoding Configuration
2
3 Here is below the configuration for UTF-8. Note that this is valid for XWiki 1.0 b5 and above. Easier configuration might be provided for upcoming releases.
4
5 1.1 XWiki encoding
6
7 Change the charset enconding in these XWiki files :
8
9 * *web.xml*: locate the filter class com.xpn.xwiki.web.SetCharacterEncodingFilter and change it to UTF-8. It should look like this
10
11 {code:xml}
12 <filter>
13 <filter-name>Set Character Encoding</filter-name>
14 <filter-class>com.xpn.xwiki.web.SetCharacterEncodingFilter</filter-class>
15 <init-param>
16 <param-name>encoding</param-name>
17 <param-value>UTF-8</param-value>
18 </init-param>
19 </filter>
20 {code}
21
22 * *xwiki.cfg* : locate the line containing xwiki.encoding and change it to look like this
23 {code}
24 xwiki.encoding = UTF-8
25 {code}
26
27 1.1 HTML encoding
28
29 Change the HTML encoding in XWiki through Administration --> Preferences --> Presentation --> HTTP Meta information. Inside this textbox locate the *Content-type* meta tag and make it look like this, changing the encoding to UTF-8
30 {code:xml}
31 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
32 {code}
33
34
35 1.1 Hibernate configuration
36 Add the following lines in the <tt>hibernate.cfg.xml</tt> file:
37 {code:xml}
38 <property name="connection.useUnicode">true</property>
39 <property name="connection.characterEncoding">UTF-8</property>
40 {code}
41
42 1.1 MySQL configuration
43
44 It's common practice that the MySQL configuration file, in \*nix systems is located in /etc/mysql/my.cnf
45 {code}
46 [client]
47 default-character-set=utf8
48 [mysqld]
49 default-character-set=utf8
50 character-set-server = utf8
51 collation-server = utf8_general_ci
52 {code}
53
54 1.1 Java application server (Tomcat or Jetty for instance)
55
56 Check the following parameters for your Tomcat UTF-8 encoding (under Linux, check catalina.sh):---------------------------------
57
58 {code}
59 echo off
60 rem set LANG=fr_FR.ISO8859-1
61 set LANG=en_US.UTF-8
62 set JETTY_PORT=8080
63 set JETTY_HOME=.
64 java %JAVA_OPTS% -Djetty.port=%JETTY_PORT% -Djetty.home=%JETTY_HOME% -Dfile.encoding=UTF-8 -jar %JETTY_HOME%/start.jar
65 {code}
66
67 Instead of config system variable LANG you can use JVM properties
68
69 {code}
70 -Duser.language=en
71 -Duser.country=US
72 {code}
73
74 in server startup script.
75
76 1.1 System config
77
78 Add the following variables to your system
79
80 {code}
81 LANG = en_US.UTF8
82 {code}
83
84 Credits: http://www.nabble.com/Re%3A-problem-with-Chinese-p9547507.html

Get Connected