Wiki source code of Encoding
Last modified by Vincent Massol on 2020/06/25
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
13.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
2 | {{toc/}} | ||
3 | {{/box}} | ||
![]() |
1.1 | 4 | |
![]() |
25.1 | 5 | Below you have the configuration for UTF-8. |
![]() |
1.1 | 6 | |
![]() |
12.2 | 7 | = Servlet Container = |
![]() |
1.1 | 8 | |
![]() |
26.2 | 9 | == Tomcat == |
10 | |||
![]() |
26.4 | 11 | Since Tomcat 8.0.x, the [[##URIEncoding## property is ##UTF8## by default>>http://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Common_Attributes]]: |
![]() |
26.2 | 12 | |
![]() |
26.3 | 13 | > This specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, UTF-8 will be used unless the org.apache.catalina.STRICT_SERVLET_COMPLIANCE system property is set to true in which case ISO-8859-1 will be used. |
![]() |
26.2 | 14 | |
![]() |
12.2 | 15 | == Jetty == |
![]() |
12.1 | 16 | |
![]() |
16.1 | 17 | {{code}} |
18 | echo off | ||
![]() |
1.1 | 19 | rem set LANG=fr_FR.ISO8859-1 |
20 | set LANG=en_US.UTF-8 | ||
21 | set JETTY_PORT=8080 | ||
22 | set JETTY_HOME=. | ||
![]() |
15.2 | 23 | java %JAVA_OPTS% -Djetty.port=%JETTY_PORT% -Djetty.home=%JETTY_HOME% -Dfile.encoding=UTF-8 -jar %JETTY_HOME%/start.jar |
24 | {{/code}} | ||
![]() |
1.4 | 25 | |
![]() |
15.2 | 26 | Instead of the config system variable LANG you can use JVM properties. |
27 | |||
![]() |
12.1 | 28 | {{code}} |
![]() |
1.4 | 29 | -Duser.language=en |
30 | -Duser.country=US | ||
![]() |
12.1 | 31 | {{/code}} |
![]() |
1.4 | 32 | |
33 | in server startup script. | ||
34 | |||
![]() |
15.2 | 35 | == [[Glassfish>>http://glassfish.java.net/]] == |
![]() |
9.1 | 36 | |
![]() |
19.5 | 37 | To run XWiki with UTF-8 in Glassfish you will need to recreate the XWiki WAR file and do a change to the glassfish config. First, in the Administration GUI under Domain => General => Locale enter **en_US.UTF-8**. |
![]() |
9.1 | 38 | |
![]() |
15.2 | 39 | Now you will need to add all the aforementioned changes from this document to the files in the war file, create a new warfile, and deploy that one to your glassfish installation. This is required due to the fact that Glassfish will not accept changes to a deployed web.xml file. So you need to deploy a ready changed **web.xml** file inside your war file because all subsequent changes to the deployed **web.xml** file in the filesystem are totally ignored. |
![]() |
12.1 | 40 | |
![]() |
15.2 | 41 | Create a new directory that we will use as a temporary place to edit our war file: |
![]() |
12.1 | 42 | |
43 | {{code}} | ||
44 | mkdir xwikitmp | ||
45 | {{/code}} | ||
46 | |||
![]() |
19.6 | 47 | Unpack the warfile (replace ##<suffix>## with the proper name for the version of XWiki you're using): |
![]() |
12.1 | 48 | |
49 | {{code}} | ||
![]() |
19.6 | 50 | cd xwikitemp;jar xvf ../xwiki-<suffix>.war |
![]() |
12.1 | 51 | {{/code}} |
52 | |||
![]() |
9.1 | 53 | Edit the files as mentioned in the beginning of this article: |
![]() |
12.1 | 54 | |
![]() |
9.1 | 55 | * wiki.cfg |
56 | * web.xml | ||
57 | * hibernate.cfg.xml | ||
![]() |
12.1 | 58 | |
![]() |
15.2 | 59 | Now let's create a new warfile which contains all the changes: |
![]() |
9.1 | 60 | |
![]() |
12.1 | 61 | {{code}} |
![]() |
19.7 | 62 | jar cvf ../xwiki-<suffix>.war . |
![]() |
12.1 | 63 | {{/code}} |
64 | |||
![]() |
9.1 | 65 | Now you can deploy your new .war file to Glassfish and it will have all the changes in it and wll be correctly deployed. |
66 | |||
![]() |
20.1 | 67 | = Web server = |
68 | |||
69 | == Apache == | ||
70 | |||
71 | Make sure that the Apache configuration file ##httpd.conf## contains the following line: | ||
72 | |||
73 | {{code}} | ||
74 | AddDefaultCharset UTF-8 | ||
75 | {{/code}} | ||
76 | |||
![]() |
12.2 | 77 | = System config = |
![]() |
9.1 | 78 | |
![]() |
15.2 | 79 | Add the following variables to your system: |
![]() |
1.1 | 80 | |
![]() |
12.1 | 81 | {{code}} |
![]() |
2.1 | 82 | LANG = en_US.UTF-8 |
![]() |
12.1 | 83 | {{/code}} |
![]() |
1.1 | 84 | |
![]() |
15.2 | 85 | [[Credits>>http://markmail.org/message/qitvntzz7cwpyo2w]] |
![]() |
15.1 | 86 | |
87 | = OpenOffice import = | ||
88 | |||
![]() |
15.2 | 89 | If OpenOffice import turns characters into question marks or HTML Entity you need to edit **registrymodifications.xcu** located in user profile used by the OO server by adding: |
![]() |
15.1 | 90 | |
91 | {{code}} | ||
92 | <item | ||
93 | oor:path="/org.openoffice.Office.Common/Filter/HTML/Export"><prop | ||
94 | oor:name="Encoding" oor:op="fuse"><value>76</value></prop></item> | ||
95 | {{/code}} | ||
96 | |||
![]() |
15.2 | 97 | [[Credits>>http://lists.xwiki.org/pipermail/users/2011-November/021004.html]] |
![]() |
20.1 | 98 | |
99 | = Tools = | ||
100 | |||
101 | * The [[Admin Tools extension>>extensions:Extension.Admin Tools Application]] can be helpful to identify the values of the XWiki encoding configuration parameters on a running server. |