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) > <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]