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

Content encoding in HtmlParser

    XMLWordPrintableJSON

Details

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

    Description

      Sometimes content encoding method is stored outside html document, for instance in mime mail with html attachment.
      The problem is for text/html documents without http-equiv section. Actually there is no way to pass this information to the parser.

      My fix for parse method in HtmlParser.java:

      • parser.parse(new InputSource(stream));
        + InputSource source = new InputSource(stream);
        + String encoding = metadata.get(Metadata.CONTENT_ENCODING);
        + if (encoding != null) {
        + source.setEncoding(encoding);
        + parser.parse(source);

      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: