You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marcelo Lotif <ml...@gmail.com> on 2008/08/20 14:42:55 UTC

[T5.0.14] Problem with ANSI codification in .properties files

Hi all,

I'm experiencing a little problem with special characters (áãéõó...
and so on) after I switched to T 5.0.14: some files, mainly properties
files, are not displayed properly when they are loaded to my pages.
Since I'm running on a windows machine, all my files are saved in ANSI
by default. If I change it to UTF-8, the special characters are loaded
as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
problem also disappears. I tested with an Ubuntu machine, that saves
as UTF-8 by default, but the problem is still occurring, don't know
why. I also tested with T 5.0.15-SNAPSHOT, same problem.

This could be related with TAPESTRY-2525?

Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.

Is this the expected behavior? Is there something I'm doing wrong?
Should I fire a JIRA issue?

Thanks a lot for your help.

-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by Martijn Brinkers <m....@gmail.com>.
Strict US-ASCII character set is afaik made up of characters <= 127.
Your special characters were therefore not pure ASCII. I think that in
your case the machine your are coding on defaulted to a charset that
could handle your special characters as you intended them to be. If you
would have loaded your pre-UTF-8 properties file on a different machine
with a different default charset it could be that the special characters
suddenly had were being mapped to a different character. That's why it's
always better to use unicode (be it UTF-8, UTF-16 or whatever). Now
because the file is UTF-8 your special characters are treated as UTF-8
and therefore become corrupted. Life would have been a lot easier if
Java would support the "byte order mark" (BOM) while reading a file
because it would then be possible to detect whether the file is unicode
or not. If not unicode treat the file like it is encoded using the
default encoding.

I think http://koti.mbnet.fi/akini/java/unicodereader/ has some code
that can detect the BOM.

Martijn

On Thu, 2008-08-21 at 17:53 -0300, Marcelo Lotif wrote:
> This is what I'm already doing :)
> I just thought strange because nobody noticed yet. I had to go through
> all my .properties files changing the encoding. But fortunately, as I
> see, it's just me.
> 
> Thanks.
> 
> On Thu, Aug 21, 2008 at 5:32 PM, Martijn Brinkers (List)
> <ma...@gmail.com> wrote:
> > So what you are saying is that when you save your property file as UTF-8
> > the 'special' characters are shown correctly but not when you save your
> > propery file as a ANSI file?
> >
> > If so why don't you save it as UTF-8 and leave it this way? Or am I
> > missing something?
> >
> > Martijn
> >
> >
> > On Thu, 2008-08-21 at 17:05 -0300, Marcelo Lotif wrote:
> >> No one is having this kind of problem? I tested in other situations
> >> and this is still happening... I'll try to change my eclipse's default
> >> configuration, maybe will help for now...
> >>
> >> On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif <ml...@gmail.com> wrote:
> >> > Hi all,
> >> >
> >> > I'm experiencing a little problem with special characters (áãéõó...
> >> > and so on) after I switched to T 5.0.14: some files, mainly properties
> >> > files, are not displayed properly when they are loaded to my pages.
> >> > Since I'm running on a windows machine, all my files are saved in ANSI
> >> > by default. If I change it to UTF-8, the special characters are loaded
> >> > as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
> >> > problem also disappears. I tested with an Ubuntu machine, that saves
> >> > as UTF-8 by default, but the problem is still occurring, don't know
> >> > why. I also tested with T 5.0.15-SNAPSHOT, same problem.
> >> >
> >> > This could be related with TAPESTRY-2525?
> >> >
> >> > Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.
> >> >
> >> > Is this the expected behavior? Is there something I'm doing wrong?
> >> > Should I fire a JIRA issue?
> >> >
> >> > Thanks a lot for your help.
> >> >
> >> > --
> >> > Atenciosamente,
> >> >
> >> > Marcelo Lotif
> >> > Programador Java e Tapestry
> >> > FIEC - Federação das Indústrias do Estado do Ceará
> >> > (85) 3477-5910
> >> >
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> 
> 
> 


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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by Marcelo Lotif <ml...@gmail.com>.
This is what I'm already doing :)
I just thought strange because nobody noticed yet. I had to go through
all my .properties files changing the encoding. But fortunately, as I
see, it's just me.

Thanks.

On Thu, Aug 21, 2008 at 5:32 PM, Martijn Brinkers (List)
<ma...@gmail.com> wrote:
> So what you are saying is that when you save your property file as UTF-8
> the 'special' characters are shown correctly but not when you save your
> propery file as a ANSI file?
>
> If so why don't you save it as UTF-8 and leave it this way? Or am I
> missing something?
>
> Martijn
>
>
> On Thu, 2008-08-21 at 17:05 -0300, Marcelo Lotif wrote:
>> No one is having this kind of problem? I tested in other situations
>> and this is still happening... I'll try to change my eclipse's default
>> configuration, maybe will help for now...
>>
>> On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif <ml...@gmail.com> wrote:
>> > Hi all,
>> >
>> > I'm experiencing a little problem with special characters (áãéõó...
>> > and so on) after I switched to T 5.0.14: some files, mainly properties
>> > files, are not displayed properly when they are loaded to my pages.
>> > Since I'm running on a windows machine, all my files are saved in ANSI
>> > by default. If I change it to UTF-8, the special characters are loaded
>> > as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
>> > problem also disappears. I tested with an Ubuntu machine, that saves
>> > as UTF-8 by default, but the problem is still occurring, don't know
>> > why. I also tested with T 5.0.15-SNAPSHOT, same problem.
>> >
>> > This could be related with TAPESTRY-2525?
>> >
>> > Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.
>> >
>> > Is this the expected behavior? Is there something I'm doing wrong?
>> > Should I fire a JIRA issue?
>> >
>> > Thanks a lot for your help.
>> >
>> > --
>> > Atenciosamente,
>> >
>> > Marcelo Lotif
>> > Programador Java e Tapestry
>> > FIEC - Federação das Indústrias do Estado do Ceará
>> > (85) 3477-5910
>> >
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by "Martijn Brinkers (List)" <ma...@gmail.com>.
So what you are saying is that when you save your property file as UTF-8
the 'special' characters are shown correctly but not when you save your
propery file as a ANSI file?

If so why don't you save it as UTF-8 and leave it this way? Or am I
missing something?

Martijn


On Thu, 2008-08-21 at 17:05 -0300, Marcelo Lotif wrote:
> No one is having this kind of problem? I tested in other situations
> and this is still happening... I'll try to change my eclipse's default
> configuration, maybe will help for now...
> 
> On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif <ml...@gmail.com> wrote:
> > Hi all,
> >
> > I'm experiencing a little problem with special characters (áãéõó...
> > and so on) after I switched to T 5.0.14: some files, mainly properties
> > files, are not displayed properly when they are loaded to my pages.
> > Since I'm running on a windows machine, all my files are saved in ANSI
> > by default. If I change it to UTF-8, the special characters are loaded
> > as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
> > problem also disappears. I tested with an Ubuntu machine, that saves
> > as UTF-8 by default, but the problem is still occurring, don't know
> > why. I also tested with T 5.0.15-SNAPSHOT, same problem.
> >
> > This could be related with TAPESTRY-2525?
> >
> > Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.
> >
> > Is this the expected behavior? Is there something I'm doing wrong?
> > Should I fire a JIRA issue?
> >
> > Thanks a lot for your help.
> >
> > --
> > Atenciosamente,
> >
> > Marcelo Lotif
> > Programador Java e Tapestry
> > FIEC - Federação das Indústrias do Estado do Ceará
> > (85) 3477-5910
> >
> 
> 
> 


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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Thu, Aug 21, 2008 at 1:50 PM, Filip S. Adamsen <fs...@fsadev.com> wrote:
> Hi,
>
> Tapestry 5.0.14 changes the way .properties files are read so they are read
> in a way that works with UTF-8 encoded files, at least on Java 6.

JDK 1.5 and 1.6.

>
> Now, my guess is that they were being read correctly before because Java
> read the .properties files using the default encoding, which would probably
> be ANSI.

This is what changed between 5.0.13 and 5.0.14.  The new release reads
the content as UTF-8, and has a hack to simulate the use of
Native2Ascii.

>
> That explains why it doesn't work now, because ANSI and UTF-8 don't (AFAIK)
> match up.
>
> The UTF-8 patch only changes the encoding on form submissions, so that
> doesn't really have anything to do with the .properties files.
>
> Anyway, that's just my more or less informed guess.
>
> -Filip
>
>
-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

Tapestry 5.0.14 changes the way .properties files are read so they are 
read in a way that works with UTF-8 encoded files, at least on Java 6.

Now, my guess is that they were being read correctly before because Java 
read the .properties files using the default encoding, which would 
probably be ANSI.

That explains why it doesn't work now, because ANSI and UTF-8 don't 
(AFAIK) match up.

The UTF-8 patch only changes the encoding on form submissions, so that 
doesn't really have anything to do with the .properties files.

Anyway, that's just my more or less informed guess.

-Filip

On 2008-08-21 22:05, Marcelo Lotif wrote:
> No one is having this kind of problem? I tested in other situations
> and this is still happening... I'll try to change my eclipse's default
> configuration, maybe will help for now...
> 
> On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif <ml...@gmail.com> wrote:
>> Hi all,
>>
>> I'm experiencing a little problem with special characters (áãéõó...
>> and so on) after I switched to T 5.0.14: some files, mainly properties
>> files, are not displayed properly when they are loaded to my pages.
>> Since I'm running on a windows machine, all my files are saved in ANSI
>> by default. If I change it to UTF-8, the special characters are loaded
>> as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
>> problem also disappears. I tested with an Ubuntu machine, that saves
>> as UTF-8 by default, but the problem is still occurring, don't know
>> why. I also tested with T 5.0.15-SNAPSHOT, same problem.
>>
>> This could be related with TAPESTRY-2525?
>>
>> Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.
>>
>> Is this the expected behavior? Is there something I'm doing wrong?
>> Should I fire a JIRA issue?
>>
>> Thanks a lot for your help.
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>> Programador Java e Tapestry
>> FIEC - Federação das Indústrias do Estado do Ceará
>> (85) 3477-5910
>>
> 
> 
> 

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


Re: [T5.0.14] Problem with ANSI codification in .properties files

Posted by Marcelo Lotif <ml...@gmail.com>.
No one is having this kind of problem? I tested in other situations
and this is still happening... I'll try to change my eclipse's default
configuration, maybe will help for now...

On Wed, Aug 20, 2008 at 9:42 AM, Marcelo Lotif <ml...@gmail.com> wrote:
> Hi all,
>
> I'm experiencing a little problem with special characters (áãéõó...
> and so on) after I switched to T 5.0.14: some files, mainly properties
> files, are not displayed properly when they are loaded to my pages.
> Since I'm running on a windows machine, all my files are saved in ANSI
> by default. If I change it to UTF-8, the special characters are loaded
> as expected. If I downgrade to T 5.0.13 (with the UTF-8 patch), the
> problem also disappears. I tested with an Ubuntu machine, that saves
> as UTF-8 by default, but the problem is still occurring, don't know
> why. I also tested with T 5.0.15-SNAPSHOT, same problem.
>
> This could be related with TAPESTRY-2525?
>
> Most of my team is using Eclipse 3.3.2, Jetty 5.1.12 and Windows XP.
>
> Is this the expected behavior? Is there something I'm doing wrong?
> Should I fire a JIRA issue?
>
> Thanks a lot for your help.
>
> --
> Atenciosamente,
>
> Marcelo Lotif
> Programador Java e Tapestry
> FIEC - Federação das Indústrias do Estado do Ceará
> (85) 3477-5910
>



-- 
Atenciosamente,

Marcelo Lotif
Programador Java e Tapestry
FIEC - Federação das Indústrias do Estado do Ceará
(85) 3477-5910

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