The ? implies to me that your shell might be trying to display the UTF-8 properly, but can't, so it shows the question mark.
Instead of looking at the file with cat: - Does the file have one byte for that mark, (that would be the question mark) or 3? - You should be able to count how many bytes you expect to see. - What do you see when you open the file in a GUI editor that supports UTF-8? - How about looking at that file in a browser? Rob > -----Original Message----- > From: Scot P. Floess [mailto:sflo...@nc.rr.com] > Sent: Friday, May 27, 2011 2:12 PM > To: Ant Users List > Subject: Re: Question regarding UTF-8 and property files > > Works for me: > > <?xml version="1.0" encoding="utf-8"?> > <project name="test" default="foo"> > <target name="foo"> > <loadproperties srcFile="foo.properties" > encoding="iso-8859-1"/> > <echo message="[${foo.property}]"/> > <echo file="test.txt" message="${foo.property}"/> > </target> > </project> > > > > foo: > [echo] [Test ế] > > > > On Fri, 27 May 2011, Rob J wrote: > > > This is on a Unix box, there is no BOM in foo.properties. > > > > I just added the BOM to the file: > > > > hitman@bigdog ~/t$ file foo.properties > > foo.properties: UTF-8 Unicode (with BOM) text hitman@bigdog > ~/t$ ant > > foo > > Buildfile: /Users/hitman/t/build.xml > > > > foo: > > > > BUILD SUCCESSFUL > > Total time: 0 seconds > > hitman@bigdog ~/t$ cat test.txt > > Test ? > > > > Same thing. > > > > Any other ideas? Thanks for the help sofar. > > > > Rob > > > > On Fri, 27 May 2011, Echlin, Robert wrote: > > > >> Hi Rob, > >> Maybe you need to start the file with the Byte Order Mark? > >> This is apparently more likely if you are on Windows. > >> > >> http://en.wikipedia.org/wiki/UTF-8#Byte_order_mark > >> > >> Rob > >> > >> > >>> -----Original Message----- > >>> From: Rob J [mailto:r...@dcsportbikes.net] > >>> Sent: Friday, May 27, 2011 12:03 PM > >>> To: user@ant.apache.org > >>> Subject: Question regarding UTF-8 and property files > >>> > >>> So I'm having an issue with UTF-8 and property files. Given the > >>> test build.xml file: > >>> > >>> <?xml version="1.0" encoding="utf-8"?> <project name="test"> > >>> <target name="foo"> > >>> <loadproperties srcFile="foo.properties" encoding="utf-8"/> > >>> <echo file="test.txt" encoding="utf-8" > message="${foo.property}"/> > >>> </target> > >>> </project> > >>> > >>> and the file foo.properties: > >>> > >>> #foo.propert=Test ế > >>> foo.property=Test \u1EBF > >>> > >>> When I run ant (1.8.2) for this target and look in > test.txt, I see: > >>> > >>> Test ? > >>> > >>> every time. It is not interpreting the utf-8 character > properly and > >>> therefore is not putting it into my project properly. I've tried > >>> both the raw utf-8 character in the file as well as the \uXXXX > >>> encoded version. Both are the same. > >>> > >>> Can anyone point out where I'm going wrong with this? > >>> > >>> thanks, > >>> rob > >>> > >>> > -------------------------------------------------------------------- > >>> - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For > >>> additional commands, e-mail: user-h...@ant.apache.org > >>> > >>> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For > >> additional commands, e-mail: user-h...@ant.apache.org > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For > additional > > commands, e-mail: user-h...@ant.apache.org > > > > > > Scot P. Floess RHCT (Certificate Number 605010084735240) > Chief Architect FlossWare http://sourceforge.net/projects/flossware > http://flossware.sourceforge.net > https://github.com/organizations/FlossWare >