You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ivano Luberti <lu...@archicoop.it> on 2011/03/04 15:52:52 UTC

[OT] encoding of properties files

Hello I have a question I believe is not strictly Tapestry related.

I'm developing a web site using T 4.1.6
My dev environment is Eclipse 3.5 + Tomcat 5.5  on Windows Vista where
everything works fine (I know I know...).
Instead when I deploy the website on another machine,  characters loaded
from properties files  that have accents are not showed correctly.
I see question marks in place of the characters when I use Firefox and
squares in IE 8.

I have used ISO-8859-1 for properties files and for html templates:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


Can someone point me in the correct direction to solve this problem?





-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] encoding of properties files

Posted by Ivano Luberti <lu...@archicoop.it>.
Thanks to Hugo and Jim for their answers.
Sorry to come back on this after so much time.
I was aware of the encoding of files that Java uses for properties files
and so my editor (actually the Eclipse default properties file editor)
is set properly to ISO-8859-1 .

However my deve environment is on a Windows machine and when I test my
web site running

  System.out.println(  Default Charset=" + Charset.defaultCharset()+";"+
                    "file.encoding=" +
System.getProperty("file.encoding")+";"+
                    "Default Charset=" + Charset.defaultCharset()+";"+
                    "Default Charset in Use=" + getDefaultCharSet()));


I get

Default Charset=windows-1252;file.encoding=Cp1252;Default
Charset=windows-1252;Default Charset in Use=Cp1252

and still properties files content is dipslayed correctly
While on the server (an Ubuntu box) where pages are displayed
incorrectly the same check shows:

Default Charset=US-ASCII;file.encoding=ANSI_X3.4-1968;Default
Charset=US-ASCII;Default Charset in Use=ASCII

I asked my sys admin to work on this


Il 04/03/2011 21.34, Jim O'Callaghan ha scritto:
> 2nd try to get through spam filter...
>
> Perhaps the text editor you are using for editing your property files and templates is not character code aware, for instance old versions of Notepad.  If you are using Eclipse for editing these files it may be set to auto-detect the character encoding, and if one of the previous developers is using a clashing editor / character encoding, the meta tag in your property files and templates will be directing the browser to decode the characters using a character set that is different to the one actually used to save the content. You can check if the browser rendered content is actually ISO-8859-1 by changing the Firefox setting to the required encoding (View → Character Encoding → Western (ISO-8859-1)) instead of Auto-detect, to see if the relevant characters come out ok, if not, then I would check the editor you are using to edit the files (including history of check-ins by other developers) and make sure it is setting the encoding correctly.  Another area that may be relevant is if you have contributed a Servlet Filter, and in its service method you have used setCharacterEncoding("UTF-8") or some other invalid encoding.  I use UTF-8 project-wide, ensure my editors are character code aware, and have no problem with special characters.  I have previously encountered similar errors where non-developers were given access to files to maintain error messages / properties using older versions of Notepad.
>
> Regards,
> Jim.
>
> From: Ivano Luberti [mailto:luberti@archicoop.it] 
> Sent: 04 March 2011 14:53
> To: Tapestry users
> Subject: [OT] encoding of properties files
>
> Hello I have a question I believe is not strictly Tapestry related.
>
> I'm developing a web site using T 4.1.6
> My dev environment is Eclipse 3.5 + Tomcat 5.5  on Windows Vista where
> everything works fine (I know I know...).
> Instead when I deploy the website on another machine,  characters loaded
> from properties files  that have accents are not showed correctly.
> I see question marks in place of the characters when I use Firefox and
> squares in IE 8.
>
> I have used ISO-8859-1 for properties files and for html templates:
>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>
>
> Can someone point me in the correct direction to solve this problem?
>
>
>
>
>
> --
> ==================================================
> dott. Ivano Mario Luberti
> Archimede Informatica societa' cooperativa a r. l.
> Sede Operativa
> Via Gereschi 36 - 56126- Pisa
> tel.: +39-050- 580959
> tel/fax: +39-050-9711344
> web: www.archicoop.it
> ==================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> ________________________________________
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1204 / Virus Database: 1435/3480 - Release Date: 03/03/11
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] encoding of properties files

Posted by Ivano Luberti <lu...@archicoop.it>.
Thanks to Hugo and Jim for their answers.
I was aware of the encoding of files that Java uses for properties files
and so my editor (actually the Eclipse default properties file editor)
is set properly to ISO-8859-1 .

However my deve environment is on a Windows machine and when I test my
web site running

  System.out.println(  Default Charset=" + Charset.defaultCharset()+";"+
                    "file.encoding=" +
System.getProperty("file.encoding")+";"+
                    "Default Charset=" + Charset.defaultCharset()+";"+
                    "Default Charset in Use=" + getDefaultCharSet()));


I get

Default Charset=windows-1252;file.encoding=Cp1252;Default
Charset=windows-1252;Default Charset in Use=Cp1252

and still properties files content is dipslayed correctly
While on the server (an Ubuntu box) where pages are displayed
incorrectly the same check shows:

Default Charset=US-ASCII;file.encoding=ANSI_X3.4-1968;Default
Charset=US-ASCII;Default Charset in Use=ASCII




Il 04/03/2011 21.34, Jim O'Callaghan ha scritto:
> 2nd try to get through spam filter...
>
> Perhaps the text editor you are using for editing your property files and templates is not character code aware, for instance old versions of Notepad.  If you are using Eclipse for editing these files it may be set to auto-detect the character encoding, and if one of the previous developers is using a clashing editor / character encoding, the meta tag in your property files and templates will be directing the browser to decode the characters using a character set that is different to the one actually used to save the content. You can check if the browser rendered content is actually ISO-8859-1 by changing the Firefox setting to the required encoding (View → Character Encoding → Western (ISO-8859-1)) instead of Auto-detect, to see if the relevant characters come out ok, if not, then I would check the editor you are using to edit the files (including history of check-ins by other developers) and make sure it is setting the encoding correctly.  Another area that may be relevant is if you have contributed a Servlet Filter, and in its service method you have used setCharacterEncoding("UTF-8") or some other invalid encoding.  I use UTF-8 project-wide, ensure my editors are character code aware, and have no problem with special characters.  I have previously encountered similar errors where non-developers were given access to files to maintain error messages / properties using older versions of Notepad.
>
> Regards,
> Jim.
>
> From: Ivano Luberti [mailto:luberti@archicoop.it] 
> Sent: 04 March 2011 14:53
> To: Tapestry users
> Subject: [OT] encoding of properties files
>
> Hello I have a question I believe is not strictly Tapestry related.
>
> I'm developing a web site using T 4.1.6
> My dev environment is Eclipse 3.5 + Tomcat 5.5  on Windows Vista where
> everything works fine (I know I know...).
> Instead when I deploy the website on another machine,  characters loaded
> from properties files  that have accents are not showed correctly.
> I see question marks in place of the characters when I use Firefox and
> squares in IE 8.
>
> I have used ISO-8859-1 for properties files and for html templates:
>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>
>
> Can someone point me in the correct direction to solve this problem?
>
>
>
>
>
> --
> ==================================================
> dott. Ivano Mario Luberti
> Archimede Informatica societa' cooperativa a r. l.
> Sede Operativa
> Via Gereschi 36 - 56126- Pisa
> tel.: +39-050- 580959
> tel/fax: +39-050-9711344
> web: www.archicoop.it
> ==================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> ________________________________________
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1204 / Virus Database: 1435/3480 - Release Date: 03/03/11
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: [OT] encoding of properties files

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
2nd try to get through spam filter...

Perhaps the text editor you are using for editing your property files and templates is not character code aware, for instance old versions of Notepad.  If you are using Eclipse for editing these files it may be set to auto-detect the character encoding, and if one of the previous developers is using a clashing editor / character encoding, the meta tag in your property files and templates will be directing the browser to decode the characters using a character set that is different to the one actually used to save the content. You can check if the browser rendered content is actually ISO-8859-1 by changing the Firefox setting to the required encoding (View → Character Encoding → Western (ISO-8859-1)) instead of Auto-detect, to see if the relevant characters come out ok, if not, then I would check the editor you are using to edit the files (including history of check-ins by other developers) and make sure it is setting the encoding correctly.  Another area that may be relevant is if you have contributed a Servlet Filter, and in its service method you have used setCharacterEncoding("UTF-8") or some other invalid encoding.  I use UTF-8 project-wide, ensure my editors are character code aware, and have no problem with special characters.  I have previously encountered similar errors where non-developers were given access to files to maintain error messages / properties using older versions of Notepad.

Regards,
Jim.

From: Ivano Luberti [mailto:luberti@archicoop.it] 
Sent: 04 March 2011 14:53
To: Tapestry users
Subject: [OT] encoding of properties files

Hello I have a question I believe is not strictly Tapestry related.

I'm developing a web site using T 4.1.6
My dev environment is Eclipse 3.5 + Tomcat 5.5  on Windows Vista where
everything works fine (I know I know...).
Instead when I deploy the website on another machine,  characters loaded
from properties files  that have accents are not showed correctly.
I see question marks in place of the characters when I use Firefox and
squares in IE 8.

I have used ISO-8859-1 for properties files and for html templates:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


Can someone point me in the correct direction to solve this problem?





--
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
________________________________________
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1204 / Virus Database: 1435/3480 - Release Date: 03/03/11


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [OT] encoding of properties files

Posted by Hugo Palma <hu...@gmail.com>.
Have you checked if the jvm property file.encoding is set to iso88591 in
both systems ?

On Fri, Mar 4, 2011 at 14:52, Ivano Luberti <lu...@archicoop.it> wrote:

> Hello I have a question I believe is not strictly Tapestry related.
>
> I'm developing a web site using T 4.1.6
> My dev environment is Eclipse 3.5 + Tomcat 5.5  on Windows Vista where
> everything works fine (I know I know...).
> Instead when I deploy the website on another machine,  characters loaded
> from properties files  that have accents are not showed correctly.
> I see question marks in place of the characters when I use Firefox and
> squares in IE 8.
>
> I have used ISO-8859-1 for properties files and for html templates:
>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>
>
> Can someone point me in the correct direction to solve this problem?
>
>
>
>
>
> --
> ==================================================
> dott. Ivano Mario Luberti
> Archimede Informatica societa' cooperativa a r. l.
> Sede Operativa
> Via Gereschi 36 - 56126- Pisa
> tel.: +39-050- 580959
> tel/fax: +39-050-9711344
> web: www.archicoop.it
> ==================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 

LinkedIn <http://www.linkedin.com/in/hugopalma>
Twitter<http://twitter.com/hugompalma>