[ https://issues.apache.org/jira/browse/TIKA-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152119#comment-13152119 ]
Michael McCandless commented on TIKA-782: ----------------------------------------- bq. I'll make the necessary changes. Thanks! bq. Do you mind if I changed the <long> parameter of processControlWord() to an <int>. Hrm, the 1.8 spec says this: {noformat} The parameter can be a positive or negative number. The range of the values for the number is generally –32767 through 32767. However, Word tends to restrict the range to –31680 through 31680 and also allows values in the range –2,147,483,648 to 2,147,483,648 for a small number of keywords (specifically \bin, \revdttm, and some picture properties). An RTF parser must allow an arbitrary string of digits as a legal value for a keyword (providing it does not exceed value ranges noted earlier). {noformat} But you're right the 1.9 spec changed the max to Integer.MAX_VALUE... I guess they changed it for 1.9, and this was a "bug" in the 1.8 spec ;) So I think int is safe! > Add support for parsing binary data in RTF files > ------------------------------------------------ > > Key: TIKA-782 > URL: https://issues.apache.org/jira/browse/TIKA-782 > Project: Tika > Issue Type: Improvement > Components: parser > Affects Versions: 1.0 > Reporter: Arjohn Kampman > Assignee: Michael McCandless > Attachments: bin.patch, bin2.patch > > > The current RTF parser doesn't process \bin control words yet. These control > words are followed by a specific amount of binary data. Because of this, the > RTF parser trips over some of these bytes in a number of (classified) > documents. > I've implemented processing of the \bin control word, but it required of the > core parsing algorithm. IMHO, it also improved readability of the code. I > hope you will accept this patch. Please let me know if the patch requires > modifications. > Apart from the \bin code word, this patch also makes the parser stop after > reading the document-closing '}' character. In a number of files (again, > classified), the parser would include non-readable characters that appeared > after this closing brace. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira