You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Junek Leoš <ju...@oksystem.cz> on 2013/12/30 14:11:25 UTC

Setting right encoding in JSPwiki 2.9.1

Hello!

I managed to migrate JSPwiki 2.8.3 (old) on server 1 to JSPwiki 2.9.1-incubating-4 on server 2 (new). The last thing to do is to set right encoding.
I am using Tomcat 7.0.29 at Oracle Enterprise Linux 6.4.

In my web.xml, server.xml and jspwiki.properties encoding UTF-8 is set. However, the main page seems like those pages encoded in UTF-8 with wrong encoding set.

Can you help me, please?

Is that caused by bug mentioned in https://issues.apache.org/jira/browse/JSPWIKI-784 ?

With regards,

Leos

Leoš Junek, IT Systems Administrator
OKsystem s.r.o.
Na Pankráci 125, 140 21 Praha 4, Czech Republic
tel: +420 236 072 268, fax: +420 236 072 112
e-mail: junek@oksystem.cz<ma...@oksystem.cz>, web: www.oksystem.cz<http://www.oksystem.cz>



________________________________

Upozornění společnosti OKsystem s.r.o. s ohledem na zavedené standardy ISO 9001, ISO 27001 a ISO 14001:
Tato zpráva a všechny připojené soubory jsou dle obchodního zákoníku důvěrné. Jestliže nejste zamýšleným adresátem, uvědomte prosím odesilatele a smažte zprávu i přiložené soubory.
Opravdu potřebujete vytisknout tento email? Myslete na přírodu.

Disclaimer of OKsystem s.r.o. with respect to implemented standards ISO 9001, ISO 27001 and ISO 14001:
This message and all attached files are confidential and legally privileged. If you are not the intended recipient, please notify the sender and delete the message including all attachments.
Please consider the environment before printing this email.

RE: Setting right encoding in JSPwiki 2.9.1

Posted by Junek Leoš <ju...@oksystem.cz>.
Hello Harry!

You were right in all you had said. 

In my Tomcat's server.xml I have already had URIEncoding="UTF-8" on the connector element.
In jspwiki.properties I have already had jspwiki.encoding = UTF-8.

But file.encoding Java System Property has not been set yet. And, as you mentioned, environment variable LANG was used. 
I added " -Dfile.encoding=UTF-8" to my JavaOpts and it has helped. 

Thanks a lot!

Have a nice New Years Eve and happy new year!

Leoš

-----Original Message-----
From: Harry Metske [mailto:harry.metske@gmail.com] 
Sent: 30. prosince 2013 20:11
To: user@jspwiki.apache.org
Subject: Re: Setting right encoding in JSPwiki 2.9.1

Leos,

if you are running a vanilla Tomcat (7.0.29 as you say), then JSPWIKI-784 is not causing or solving your problem.
Tomcat's server.xml should have URIEncoding="UTF-8" on the Connector element (I think you already have that).
In jspwiki.properties you should have jspwiki.encoding = UTF-8 (I think you already have that).

Then there is the file.encoding Java System Property that Tomcat is using, have you checked that ?
Check if and what value is used for file.encoding by the tomcat process, get the PID of the tomcat process, and look at /proc/<PID>/environ .
If the file.encoding Java system property is absent, the JVM will use the Linux envvar LANG ( echo $LANG).

And finally, check if the contents of the files on disk have the proper encoding, for example :

root@cn1:/var/jspwiki/pages# cat EncodingTest.txt überhacker root@cn1:/var/jspwiki/pages# hexdump EncodingTest.txt
0000000 bcc3 6562 6872 6361 656b 0d72 000a 000000d

Have you tried creating a page through JSPWiki ? Does the preview show correct encoding ?

regards,
Harry





On 30 December 2013 14:11, Junek Leoš <ju...@oksystem.cz> wrote:

>  Hello!
>
>
>
> I managed to migrate JSPwiki 2.8.3 (old) on server 1 to JSPwiki
> 2.9.1-incubating-4 on server 2 (new). The last thing to do is to set 
> right encoding.
>
> I am using Tomcat 7.0.29 at Oracle Enterprise Linux 6.4.
>
>
>
> In my web.xml, server.xml and jspwiki.properties encoding UTF-8 is set.
> However, the main page seems like those pages encoded in UTF-8 with 
> wrong encoding set.
>
>
>
> Can you help me, please?
>
>
>
> Is that caused by bug mentioned in
> https://issues.apache.org/jira/browse/JSPWIKI-784 ?
>
>
>
> With regards,
>
>
>
> Leos
>
>
>
> Leoš Junek, IT Systems Administrator
>
> OKsystem s.r.o.
>
> Na Pankráci 125, 140 21 Praha 4, Czech Republic
>
> tel: +420 236 072 268, fax: +420 236 072 112
>
> e-mail: junek@oksystem.cz, web: www.oksystem.cz
>
>
>
>
>
> ------------------------------
>
> Upozornění společnosti OKsystem s.r.o. s ohledem na zavedené standardy 
> ISO 9001, ISO 27001 a ISO 14001:
> Tato zpráva a všechny připojené soubory jsou dle obchodního zákoníku 
> důvěrné. Jestliže nejste zamýšleným adresátem, uvědomte prosím 
> odesilatele a smažte zprávu i přiložené soubory.
> Opravdu potřebujete vytisknout tento email? Myslete na přírodu.
>
> Disclaimer of OKsystem s.r.o. with respect to implemented standards 
> ISO 9001, ISO 27001 and ISO 14001:
> This message and all attached files are confidential and legally 
> privileged. If you are not the intended recipient, please notify the 
> sender and delete the message including all attachments.
> Please consider the environment before printing this email.
>

Re: Setting right encoding in JSPwiki 2.9.1

Posted by Harry Metske <ha...@gmail.com>.
Leos,

if you are running a vanilla Tomcat (7.0.29 as you say), then JSPWIKI-784
is not causing or solving your problem.
Tomcat's server.xml should have URIEncoding="UTF-8" on the Connector
element (I think you already have that).
In jspwiki.properties you should have jspwiki.encoding = UTF-8 (I think you
already have that).

Then there is the file.encoding Java System Property that Tomcat is using,
have you checked that ?
Check if and what value is used for file.encoding by the tomcat process,
get the PID of the tomcat process, and look at /proc/<PID>/environ .
If the file.encoding Java system property is absent, the JVM will use the
Linux envvar LANG ( echo $LANG).

And finally, check if the contents of the files on disk have the proper
encoding, for example :

root@cn1:/var/jspwiki/pages# cat EncodingTest.txt
überhacker
root@cn1:/var/jspwiki/pages# hexdump EncodingTest.txt
0000000 bcc3 6562 6872 6361 656b 0d72 000a
000000d

Have you tried creating a page through JSPWiki ? Does the preview show
correct encoding ?

regards,
Harry





On 30 December 2013 14:11, Junek Leoš <ju...@oksystem.cz> wrote:

>  Hello!
>
>
>
> I managed to migrate JSPwiki 2.8.3 (old) on server 1 to JSPwiki
> 2.9.1-incubating-4 on server 2 (new). The last thing to do is to set right
> encoding.
>
> I am using Tomcat 7.0.29 at Oracle Enterprise Linux 6.4.
>
>
>
> In my web.xml, server.xml and jspwiki.properties encoding UTF-8 is set.
> However, the main page seems like those pages encoded in UTF-8 with wrong
> encoding set.
>
>
>
> Can you help me, please?
>
>
>
> Is that caused by bug mentioned in
> https://issues.apache.org/jira/browse/JSPWIKI-784 ?
>
>
>
> With regards,
>
>
>
> Leos
>
>
>
> Leoš Junek, IT Systems Administrator
>
> OKsystem s.r.o.
>
> Na Pankráci 125, 140 21 Praha 4, Czech Republic
>
> tel: +420 236 072 268, fax: +420 236 072 112
>
> e-mail: junek@oksystem.cz, web: www.oksystem.cz
>
>
>
>
>
> ------------------------------
>
> Upozornění společnosti OKsystem s.r.o. s ohledem na zavedené standardy ISO
> 9001, ISO 27001 a ISO 14001:
> Tato zpráva a všechny připojené soubory jsou dle obchodního zákoníku
> důvěrné. Jestliže nejste zamýšleným adresátem, uvědomte prosím odesilatele
> a smažte zprávu i přiložené soubory.
> Opravdu potřebujete vytisknout tento email? Myslete na přírodu.
>
> Disclaimer of OKsystem s.r.o. with respect to implemented standards ISO
> 9001, ISO 27001 and ISO 14001:
> This message and all attached files are confidential and legally
> privileged. If you are not the intended recipient, please notify the sender
> and delete the message including all attachments.
> Please consider the environment before printing this email.
>