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.
<loadproperties><filterchain><replacestring> seems to fail to honor the active encoding. The following is a fragment of the JavaSE application project's build-impl.xml in case "Use Dedicated folder for Storing Libraries" was selected: <loadproperties srcfile="${libraries.1.dir}/${libraries.1.basename}-private.properties"> <filterchain> <replacestring from="$${base}" to="${libraries.1.dir}"/> </filterchain> </loadproperties> The build process fails in case the value of "${libraries.1.dir}" contains some "exotic" characters (such as Slovak letter 'ť'). Steps to reproduce the problem: 1, create user named "Rasťo" under windows xp (czech version). 2, log in as "Rasťo". 3, launch Netbeans. 4, create Java aplication project with dedicated folder for libraries. 5, build results in failure.
Created attachment 77506 [details] Evidence of the errorneous encoding operation
Are you able to run the same script from command line? What build failure are you referring to?
You might not have noticed I gave you an complete unambiguous description of the steps required to reproduce the problem. Anyway, I append the file containing the ant's debugging output.
Created attachment 77542 [details] Ant's detailed debug output
Created attachment 77543 [details] Ant's detailed debug output
I have noticed and steps to reproduce are OK, but build failure wasn't described in original report and my other question still holds: Are you able to run the same script from command line? It's very likely that the problem is in Ant tool itself.
Unfortunatelly I don't think I have sufficient expertize on how to launch the ant properly from command line on windows platform (especially what environment variables are to be set etc.). I agree the issue seems to be caused by the ant itself.
Looks like a bug in the script to me. Although filter chains are character-oriented, LoadProperties.java uses the encoding (if supplied) only to decode/encode the file for the benefit of filter chains, but finally uses Properties.load(InputStream), which assumes ISO-8859-1 encoding. You would probably need to do something like this: <loadproperties srcfile="${libraries.1.dir}/${libraries.1.basename}-private.properties" encoding="ISO-8859-1"> <filterchain> <replacestring from="$${base}" to="${libraries.1.dir}"/> <escapeunicode/> </filterchain> </loadproperties>
Yes, that fixes it. I event tried it without setting the encoding explicitly via 'encoding' attribute of <loadproperties> element, and it worked too. In other words, is 'encoding="ISO-8859-1"' necessary ? It seems like build scripts of some project templates are to be fixed accordingly.
This seems to be related to bug 155877
encoding="ISO-8859-1" would matter only if someone used unescaped Latin-1 chars in libs.properties, which is unlikely but technically legal.
Seems like a simple fix, are you sure you want to defer this?
Created attachment 82041 [details] proposed fix
Jesse, please review the patch. Thanks.
Looks right, though it should be applied also to all other project types using <loadproperties> for sharable libs.
Fixed for: j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl web.project/src/org/netbeans/modules/web/project/resources/build-impl.xsl http://hg.netbeans.org/core-main/rev/dd26bd3c27f4
BTW it is a good idea to increment the spec versions of affected modules, too, since GeneratedFilesHelper uses this to figure out whether a different version of the stylesheet is actually supposed to be new & improved. For example, a dev build currently gives this when opening a project last edited just before your fix: --- genfiles.properties Base (BASE) +++ genfiles.properties Locally Modified (Based On LOCAL) @@ -5,4 +5,4 @@ # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=301b1beb nbproject/build-impl.xml.script.CRC32=161a25fa -nbproject/build-impl.xml.stylesheet.CRC32=8bdbeca0@1.25.0.45 +nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.25.0.45 whereas you would want to see --- genfiles.properties Base (BASE) +++ genfiles.properties Locally Modified (Based On LOCAL) @@ -5,4 +5,4 @@ # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=301b1beb nbproject/build-impl.xml.script.CRC32=161a25fa -nbproject/build-impl.xml.stylesheet.CRC32=8bdbeca0@1.25.0.45 +nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.0.45 ^ so that the change will not get reverted by someone using a slightly older IDE.
Integrated into 'main-golden', will be available in build *200905181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/dd26bd3c27f4 User: Milan Kubec <mkubec@netbeans.org> Log: #159366: problems when loading localized properties
Spec. versions incremented. http://hg.netbeans.org/core-main/rev/9de47f3ba0ea
Integrated into 'main-golden', will be available in build *200905200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/9de47f3ba0ea User: Milan Kubec <mkubec@netbeans.org> Log: #159366: incrementing spec versions because of recent changes in build-impl.xsl