Re: Decode Header Error

Giganews Newsgroups
Subject: Re: Decode Header Error
Posted by:  Ciaran Costelloe (ccostell…@flogas.ie)
Date: Thu, 18 Sep 2003

Update to the latest Indy 9 release athttp://www.indyprojects.org

And don't crosspost!

"Antonello Carlomagno" <a.carlomag…@grupposynergica.it> wrote in message
news:39EC2023577FE240a.carlomag…@grupposynergica.it...
> HI,
> I hope that someone can help me. my indy version is 9.0.4
>
> I tried to receive a email header from my mailbox.
> There are 10 message,
>
> - Connect with idPOP3
> - call idPOP3.retreiveheader( nr, idMessage);
>
> but when read the 5Th header message I received this error:  '$?i' is not
a
> valid integer value
>
> I found in the source that the error is in the decode subject.....
> the subject of email is:
>
> Subject: =?iso-8859-1?Q?IT_Insights_=96_Reaping_value_from_information_?=
>
> =?iso-8859-1?Q?assets_-_Adaptive_Organization=3A_Where_and_When_Is_the?=
>
> =?iso-8859-1?Q?_R_=3D=3Fiso-8859-1=3FQ=3FOI=3F_=3D96_Complete_guide_to?=
>        =?iso-8859-1?Q?_Wireless_LAN_policy=3F=3D?=
>
> I found the except raised in this point of idCoderHeader:
> ---------------------------------
> // Get the HeaderEncoding
>        if (AnsiSameText(HeaderEncoding, 'Q')) {Do not Localize}
>        and (EncodingFound) then
>        begin
>          i := 1;
>          s := '';        {Do not Localize}
>          repeat // substring can be accessed by index here, because we
know
> that it ends with '?='    {Do not Localize}
>            if substring[i] = '_' then  {Do not Localize}
>            begin
>              s := s + ' ';    {Do not Localize}
>            end else if (substring[i] = '=') and
(Length(substring)>=i+2+2)
> then //make sure we can access i+2 and '?=' is still beyond    {Do not
> Localize}
>            begin
>              s := s + chr(StrToInt('$' + substring[i+1] +
substring[i+2]));
> {Do not Localize}  <----------------------------------ERROR !!!!!!!!!!!!!
>              inc(i,2);
>            end else
>            begin
>              s := s + substring[i];
>            end;
>            inc(i);
>          until (substring[i]='?') and (substring[i+1]='=')  {Do not
> Localize}
>        end else if EncodingFound then
> ---------------------------------
>
> please help
> antonello

Replies

In response to

Decode Header Error posted by Antonello Carlomagno on Thu, 18 Sep 2003