File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes build.xml ... what am I doing wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "build.xml ... what am I doing wrong?" Watch "build.xml ... what am I doing wrong?" New topic
Author

build.xml ... what am I doing wrong?

Donald Wedding
Ranch Hand

Joined: Aug 28, 2001
Posts: 72
Here is my build.xml



c:\ant
Buildfile: build.xml
BUILD FAILED
Error reading project file: Invalid byte 1 of 1-byte UTF-8 sequence.
Total time: 1 second
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

You need to put endcoding="UTF-8" in the xml line
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

I don't have that in my build.xml files. My xml lines look just like his. Do you think Donald is in a different locale, or is he using unusual characters that I don't see?
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

Donald,
What locale are you using, English? You can email me your build.xml file and I can run it on my machine to see if I get the same error.

Barry
Donald Wedding
Ranch Hand

Joined: Aug 28, 2001
Posts: 72
Well, I kept banging my head on this. I took the hints from your posts and I started looking at the characters individually.
I just discovered that one of my " characters was a funny looking " (almost italics looking) I don't know how it happened or how it got there. Heck, my keyboard doesn't even make that character. Anyways, I typed over it and voila, it works.
I wish that I had first tried the "encoding="UTF8" that was suggested. I'm interested to see if that would work.
Thanks for all your help! Your posts put me onto the solution.
Hans Freund
Greenhorn

Joined: Feb 27, 2004
Posts: 1
Originally posted by Donald Wedding:

I just discovered that one of my " characters was a funny looking " (almost italics looking) I don't know how it happened or how it got there. Heck, my keyboard doesn't even make that character. Anyways, I typed over it and voila, it works.

This could come from copy and paste. For example, if you copy a code snippet out of a browser and paste it into a text editor without proper encoding, the resulting text could contain special characters
[ February 27, 2004: Message edited by: Hans Freund ]
Sergio Rico
Greenhorn

Joined: Sep 24, 2004
Posts: 1
Simple typos can cause this too - � instead of $ in a property reference for example.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Especially beware of cutting from Word, Publisher and other similar programs. They often convert simple typed "'s into "smart quotes" which are invalid characters in this context.
[ September 24, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: build.xml ... what am I doing wrong?