#129 Locator2.getEncoding() returns incorrect value

closed-fixed
scanner (58)
9
2014-08-24
2011-07-28
No

When handling documents with a <?xml version="1.0" encoding="UTF-8"?> prolog, the scanner properly changes the encoding of the input stream but does not change the encoding field in the CurrentEntity.

This can be fixed by resetting CurrentEntity.encoding to the return value of InputStreamReader.getEncoding() in CurrentEntity.changeEncoding(InputStreamreader).

Discussion

  • Joshua Storck

    Joshua Storck - 2011-07-28

    Suggested patch

     
    Attachments
  • Joshua Storck

    Joshua Storck - 2011-07-28
    • priority: 5 --> 9
     
  • Marc Guillemot

    Marc Guillemot - 2011-07-28

    can you provide an example / unit test illustrating the problem?

     
  • Marc Guillemot

    Marc Guillemot - 2011-07-28
    • status: open --> pending
     
  • Joshua Storck

    Joshua Storck - 2011-07-28

    Attached a unit test to illustrate the bug. Once this test passes, everything is good.

     
  • Joshua Storck

    Joshua Storck - 2011-07-28
    • status: pending --> open
     
  • Marc Guillemot

    Marc Guillemot - 2011-07-29

    I don't see any unit test attached :-(

     
  • Marc Guillemot

    Marc Guillemot - 2011-07-29
    • status: open --> pending
     
  • Joshua Storck

    Joshua Storck - 2011-07-29

    Sorry, it appears the upload didn't work on my last post

     
  • Joshua Storck

    Joshua Storck - 2011-07-29
    • status: pending --> open
     
  • Joshua Storck

    Joshua Storck - 2011-08-01

    Did you have a chance to run the unit test and verify the bug?

     
  • Marc Guillemot

    Marc Guillemot - 2011-08-03

    Now fixed in SVN. Thanks for reporting.

    Note that I've adapted your test a bit to allow it to run for all versions of Xerces supported by NekoHTML.

     
  • Marc Guillemot

    Marc Guillemot - 2011-08-03
    • assigned_to: nobody --> mguillem
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks