Wiki source code of Encoding
Version 24.1 by Thomas Mortagne on 2020/03/11
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
13.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
2 | {{toc/}} | ||
3 | {{/box}} | ||
![]() |
1.1 | 4 | |
![]() |
15.2 | 5 | Below you have 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. |
![]() |
1.1 | 6 | |
![]() |
12.2 | 7 | = Servlet Container = |
![]() |
1.1 | 8 | |
![]() |
12.2 | 9 | == Jetty == |
![]() |
12.1 | 10 | |
![]() |
16.1 | 11 | {{code}} |
12 | echo off | ||
![]() |
1.1 | 13 | rem set LANG=fr_FR.ISO8859-1 |
14 | set LANG=en_US.UTF-8 | ||
15 | set JETTY_PORT=8080 | ||
16 | set JETTY_HOME=. | ||
![]() |
15.2 | 17 | java %JAVA_OPTS% -Djetty.port=%JETTY_PORT% -Djetty.home=%JETTY_HOME% -Dfile.encoding=UTF-8 -jar %JETTY_HOME%/start.jar |
18 | {{/code}} | ||
![]() |
1.4 | 19 | |
![]() |
15.2 | 20 | Instead of the config system variable LANG you can use JVM properties. |
21 | |||
![]() |
12.1 | 22 | {{code}} |
![]() |
1.4 | 23 | -Duser.language=en |
24 | -Duser.country=US | ||
![]() |
12.1 | 25 | {{/code}} |
![]() |
1.4 | 26 | |
27 | in server startup script. | ||
28 | |||
![]() |
12.2 | 29 | == Tomcat == |
![]() |
3.1 | 30 | |
31 | In order to enable UTF-8 in tomcat, you have to add | ||
32 | |||
![]() |
12.1 | 33 | {{code}} |
![]() |
6.1 | 34 | URIEncoding="UTF-8" |
![]() |
12.1 | 35 | {{/code}} |
![]() |
3.1 | 36 | |
![]() |
15.2 | 37 | to each connector enabled/used in ##conf/server.xml##. For example the non-SSL HTTP Connector should read: |
![]() |
3.1 | 38 | |
![]() |
12.1 | 39 | {{code language="xml"}} |
![]() |
3.1 | 40 | <Connector port="8080" maxHttpHeaderSize="8192" |
41 | maxThreads="150" minSpareThreads="25" maxSpareThreads="75" | ||
42 | enableLookups="false" redirectPort="8443" acceptCount="100" | ||
43 | connectionTimeout="20000" disableUploadTimeout="true" | ||
![]() |
6.1 | 44 | URIEncoding="UTF-8"/> |
![]() |
12.1 | 45 | {{/code}} |
![]() |
3.1 | 46 | |
![]() |
12.1 | 47 | {{warning}} |
48 | In case you're using AJP to connect Tomcat and httpd, make sure you add this attribute to the AJP connector. | ||
49 | {{/warning}} | ||
![]() |
9.1 | 50 | |
![]() |
15.2 | 51 | == [[Glassfish>>http://glassfish.java.net/]] == |
![]() |
9.1 | 52 | |
![]() |
19.5 | 53 | 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 | 54 | |
![]() |
15.2 | 55 | 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 | 56 | |
![]() |
15.2 | 57 | Create a new directory that we will use as a temporary place to edit our war file: |
![]() |
12.1 | 58 | |
59 | {{code}} | ||
60 | mkdir xwikitmp | ||
61 | {{/code}} | ||
62 | |||
![]() |
19.6 | 63 | Unpack the warfile (replace ##<suffix>## with the proper name for the version of XWiki you're using): |
![]() |
12.1 | 64 | |
65 | {{code}} | ||
![]() |
19.6 | 66 | cd xwikitemp;jar xvf ../xwiki-<suffix>.war |
![]() |
12.1 | 67 | {{/code}} |
68 | |||
![]() |
9.1 | 69 | Edit the files as mentioned in the beginning of this article: |
![]() |
12.1 | 70 | |
![]() |
9.1 | 71 | * wiki.cfg |
72 | * web.xml | ||
73 | * hibernate.cfg.xml | ||
![]() |
12.1 | 74 | |
![]() |
15.2 | 75 | Now let's create a new warfile which contains all the changes: |
![]() |
9.1 | 76 | |
![]() |
12.1 | 77 | {{code}} |
![]() |
19.7 | 78 | jar cvf ../xwiki-<suffix>.war . |
![]() |
12.1 | 79 | {{/code}} |
80 | |||
![]() |
9.1 | 81 | Now you can deploy your new .war file to Glassfish and it will have all the changes in it and wll be correctly deployed. |
82 | |||
![]() |
20.1 | 83 | = Web server = |
84 | |||
85 | == Apache == | ||
86 | |||
87 | Make sure that the Apache configuration file ##httpd.conf## contains the following line: | ||
88 | |||
89 | {{code}} | ||
90 | AddDefaultCharset UTF-8 | ||
91 | {{/code}} | ||
92 | |||
![]() |
12.2 | 93 | = System config = |
![]() |
9.1 | 94 | |
![]() |
15.2 | 95 | Add the following variables to your system: |
![]() |
1.1 | 96 | |
![]() |
12.1 | 97 | {{code}} |
![]() |
2.1 | 98 | LANG = en_US.UTF-8 |
![]() |
12.1 | 99 | {{/code}} |
![]() |
1.1 | 100 | |
![]() |
15.2 | 101 | [[Credits>>http://markmail.org/message/qitvntzz7cwpyo2w]] |
![]() |
15.1 | 102 | |
103 | = OpenOffice import = | ||
104 | |||
![]() |
15.2 | 105 | 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 | 106 | |
107 | {{code}} | ||
108 | <item | ||
109 | oor:path="/org.openoffice.Office.Common/Filter/HTML/Export"><prop | ||
110 | oor:name="Encoding" oor:op="fuse"><value>76</value></prop></item> | ||
111 | {{/code}} | ||
112 | |||
![]() |
15.2 | 113 | [[Credits>>http://lists.xwiki.org/pipermail/users/2011-November/021004.html]] |
![]() |
20.1 | 114 | |
115 | = Tools = | ||
116 | |||
117 | * 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. |