Bug in XLSHTMLParse5.DecodeQuotedPrintable

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Midiar
Posts: 11
Joined: Fri Mar 22, 2013 10:36 am

Bug in XLSHTMLParse5.DecodeQuotedPrintable

Post by Midiar »

The code in the for loop stretches beyond the length of the string:

Code: Select all

  for i := 1 to Length(Result) - 1 do begin
    if (Result[i] = '&') and (Result[i + 1] = '#') and ((Length(Result) - i) >= 3) then begin
I changed it to the following, and got rid of an error that occurred when importing mhtml xls files that were output from SAP. Or the best thing may be to shorten the for loop.

Code: Select all

  for i := 1 to Length(Result) - 1 do begin
    if ((Length(Result) - i) >= 3) and (Result[i] = '&') and (Result[i + 1] = '#') then begin
The rest of the code in the loop should be safe, as Copy adjusts itself happily to wrong indexes.
I'm using version 5.20.05.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Bug in XLSHTMLParse5.DecodeQuotedPrintable

Post by larsa »

Hello

Thank you. Your fix will be included inthe next update.
Lars Arvidsson, Axolot Data
Post Reply