This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 18171 - Use of diacritics not possible in ant build files
Summary: Use of diacritics not possible in ant build files
Status: CLOSED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jesse Glick
URL: http://ant.netbeans.org/faq.html
Keywords:
Depends on: 20532
Blocks:
  Show dependency tree
 
Reported: 2001-11-28 20:16 UTC by Elmar Zander
Modified: 2005-07-12 08:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar Zander 2001-11-28 20:16:57 UTC
When i tried to use diacritics in a build file ant complains it found an 
invalid XML character. Try for example

<target description="äöü" name="foo"/>

Then i saw the encoding declaration stated it as UTF-8 whereas the file was 
really encoded as ISO-8859-1, which is my systems default encoding. I changed 
the encoding and ant was happy. Then i modified something in my build file with 
the integrated editor but unfortunately it changed my new encoding declaration 
back to UTF-8. Since that happened all the time i finally removed the 
diacritics.

I think there is more than one possible solution:
1. always write UTF-8 and make sure that the OutputStreamWriter or whatever you 
use also uses UTF-8 (unfortunately many text editors can't handle this)
2. determine from the xml file which encoding should be used and configure the 
OSW accordingly
3. make the encoding an ant property, so that the user can determine which one 
to use

Solution 1 is by far the quickest but i would prefer 2 or 3.
Comment 1 Jesse Glick 2001-11-29 11:38:02 UTC
Please see the FAQ (URL above). Making modifications to the build
script in the Explorer currently uses a quick-and-dirty XML
regenerator which cannot easily keep your encoding intact (so it
chooses UTF-8 as the best general encoding instead). I think NetBeans
3.4 will replace the Ant module's ad-hoc XML handling code with better
general code from the XML module, which should work with encodings
correctly (your #2 I believe), as well as solving many other problems.

As a workaround, assuming you want to keep diacritics, just edit the
build script as text. The text editor will not touch the encoding
declaration of course, and if the characters are in ISO-8859-1 and
that is your platform default encoding, there should be no problem. It
is only making modifications structurally from the Explorer view of
the build script that causes the problem.
Comment 2 Marian Mirilovic 2005-07-12 08:47:16 UTC
verified / closed