this unit test shows what was expected (the comments inside explain it), and the exact thing I was trying to warn everybody = it shows that when you use the bad code "new FileReader(File)", wrong encoding is used: you have to replace it with "ReaderFactory.newXmlReader(File)"
One thing to understand is that encoding work is not done in the model, but in the calling code when creating the reader: if the reader is created with wrong encoding, it's too late, the model can't do anything. This said, I think this unit test patch isn't necessary any more: the IT does a more complete test, since it doesn't check that if a developer uses the good API the encoding is ok but it checks that Maven code actually uses the good API. But this unit test is a lot simpler to understand, and perhaps it is good to keep just to have a learning sample. If you think so and want to keep it, I advise you to change the encoding of the XML file used: it is actually in UTF-8, which is the platform encoding of some platforms (my Linux box, for example). Then the badly written test won't fail. If you transform XML file into UTF-16, the test will fail on every platform. regards, Hervé Le mercredi 17 octobre 2007, Brian E. Fox a écrit : > Herve, > Can you take a look at mng2025? I already applied the unit test patch for > maven-project to 2.0.x and trunk, but the unit tests from the patch in > maven-model are failing. Is it possible you missed an encoding fix? > > Thanks, > Brian > > -----Original Message----- > From: Hervé BOUTEMY [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 16, 2007 6:27 PM > To: Maven Developers List > Subject: Re: Maven 2.0.8 - any updates? > > work done: > - r585265 for trunk > - r585268 for 2.0.x branch > > I didn't add the integration-test attached to MNG-2254: Brian, if you can > take a look at it, please. > > More explanations about these encoding fixes can be found at > http://docs.codehaus.org/display/MAVENUSER/XML+encoding in the "Technical > Notes" section. > > There is one summary that every Maven developer should know: when reading > an XML file, don't write "new FileReader(File)" which will use platform > encoding but "ReaderFactory.newXmlReader(File)" which will detect the > encoding of the XML file (UTF-8 by default, or the encoding specified at > the beginning of the XML stream) > > Hervé > > Le mardi 16 octobre 2007, Jason van Zyl a écrit : > > On 16 Oct 07, at 6:29 AM 16 Oct 07, Brian E. Fox wrote: > > > I think we're just aiming to fix the encoding. > > > > Herve is working on that now, and then we'll release it. > > > > > -----Original Message----- > > > From: Jörg Schaible [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, October 16, 2007 4:02 AM > > > To: Maven Developers List > > > Subject: Maven 2.0.8 - any updates? > > > > > > Folks, > > > > > > are there any updates for Maven 2.0.8? What's left to finalize the > > > release? We're still stuck at M205 due to regressions in M206+M207. > > > All of this has been solved months ago. I face meanwhile quite > > > daily people dropping by in my office with Maven problems where I > > > have to say, it is solved in M208 - please wait. I know we Apache > > > people are all volunteers, therefore I'd like to know what's still > > > missing? > > > > > > - Jörg > > > > > > --------------------------------------------------------------------- > > > 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] > > > > Thanks, > > > > Jason > > > > ---------------------------------------------------------- > > Jason van Zyl > > Founder, Apache Maven > > jason at sonatype dot com > > ---------------------------------------------------------- > > > > > > > > > > --------------------------------------------------------------------- > > 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] > > > --------------------------------------------------------------------- > 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]
