Skip to content

text/rtf can have a trailing 0x00 byte #760

@gabriel-vasile

Description

@gabriel-vasile

RTF detection works fine for most samples, but Wordpad and microsoft word sometimes put a 0x00 at the end of the file.

Since RTF is a subtype of text, the 0x00 byte fails the text check and the file is considered application/octet-stream.

Options:

  • do nothing
  • move rtf so it is no longer a subtype of text -> would make rtf the single text/xxx mime that is not actually under text/plain. It would break the BinaryVSText example.
  • instruct text check to ignore that single trailing 0x00 and then, somehow, have just the rtf check proceed.

The trailing 0x00 affects other software too:
henck/rtf-html-php#65 (comment)
https://developercommunity.visualstudio.com/t/cant-open-rtf-files-in-text-editor/1154782

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions