Non-standard mime type used for OpenOffice related file types

Issue #802 new
Kuro Kurosaka created an issue

I am seeing a disagreement in the EncoderManager that is owned by a ZipFilterWriter handling the .odt file during development of SubfilteringStep.

Its mimeType is "application/x-openoffice" but the only entry in its encoders (a Hashtable) is for the key "text/x-odf".

Because they don't match, update("application/x-openoffice") assigns a new DefaultEncoder as its encoder.

Further, neither of these names seems correct. https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html says "application/vnd.oasis.opendocument.text" should be the mime type for .odt file.

These names and the mapping are defined in okapi/core/src/main/java/net/sf/okapi/common/encoder/EncoderManager.java

This needs to be reviewed and fixed. OpenOffficeFilter and its related classes should be reviewed to use the official mime type names.

A new class, net.sf.okapi.subfiltering.SubfilteringStep, in pending pull request #300 has a section marked “hack” mentioning this issue number. That section of code should be removed after this issue is resolved.

Comments (2)

  1. Chase Tingley

    I think the way the MIME/encoding system works doesn't fit cleanly with complex formats like OpenOffice or OpenXML. That said, we should make sure the MIME types are correct.

  2. Kuro Kurosaka reporter
    • edited description

    I am seeing a disagreement in the EncoderManager that is owned by a ZipFilterWriter handling the .odt file during development of SubfilteringStep.

    Its mimeType is "application/x-openoffice" but the only entry in its encoders (a Hashtable) is for the key "text/x-odf".

    Because they don't match, update("application/x-openoffice") assigns a new DefaultEncoder as its encoder.

    Further, neither of these names seems correct. https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html says "application/vnd.oasis.opendocument.text" should be the mime type for .odt file.

    These names and the mapping are defined in okapi/core/src/main/java/net/sf/okapi/common/encoder/EncoderManager.java

    This needs to be reviewed and fixed. OpenOffficeFilter and its related classes should be reviewed to use the official mime type names.

  3. Log in to comment