Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-319

HtmlParser - use encoding hint only if charset is supported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4
    • 0.5
    • parser
    • None

    Description

      Encoding hint should be considered only if that encoding is supported.

      Diff of my fix:

      — HtmlParser.java (wersja 835302)
      +++ HtmlParser.java (kopia robocza)
      @@ -46,7 +46,7 @@
      // Prepare the input source using the encoding hint if available
      InputSource source = new InputSource(stream);
      String encoding = metadata.get(Metadata.CONTENT_ENCODING);

      • if (encoding != null) {
        + if (encoding != null && Charset.isSupported(encoding)) { source.setEncoding(encoding); }

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            bartex Piotr Bartosiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: