Tika
  1. Tika
  2. TIKA-897

UTF-8 encoded XML is detected as text/plain because of UTF-8 BOM

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: mime
    • Labels:
      None

      Description

      Detection of XML fails when encoded as UTF-8. The UTF-8 BOM: 0xEF,0xBB,0xBF causes the XML detector to fail when trying to match "<?xml" at the beginning of the input stream.

        Activity

        Hide
        Nick Burch added a comment -

        We had support for detecting XML files that are ASCII, UTF-8 no-BOM, UTF-16LE and UTF-16BE.

        In r1328370 I've added detection + unit test for UTF-8 with a BOM

        We don't detect XML in UTF-32 (with or without BOMs), but I'm not sure if that's worth adding or not?

        Show
        Nick Burch added a comment - We had support for detecting XML files that are ASCII, UTF-8 no-BOM, UTF-16LE and UTF-16BE. In r1328370 I've added detection + unit test for UTF-8 with a BOM We don't detect XML in UTF-32 (with or without BOMs), but I'm not sure if that's worth adding or not?
        Hide
        Tyler Palsulich added a comment -

        Closing as fixed per Nick's comment above. We can open a new issue if someone wants UTF-32 XML detection support.

        Show
        Tyler Palsulich added a comment - Closing as fixed per Nick's comment above. We can open a new issue if someone wants UTF-32 XML detection support.

          People

          • Assignee:
            Unassigned
            Reporter:
            Wade Taylor
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development