Problem with messagem encoding in DotNET applications

Giganews Newsgroups
Subject: Problem with messagem encoding in DotNET applications
Posted by:  Marcelo Siqueira (mdmsiqueira.GOAWAY-SP…@uol.com.br)
Date: Thu, 09 Mar 2006

I need to send an email that contains foreign characters using TIdSMTP
component in a ASP.NET application with Delphi 2006. I want to send it
using the quoted-printable encoding, but I cannot get it to work right.

I'm using the TIdEncoderQuotedPrintable class to enconde my message, but
the weird thing is that this same class give me a different result when
I run it as a Win32 application and as a .NET application.

This is a very small test I made:

procedure TForm1.Button1Click(Sender: TObject);
var
  enc : TIdEncoderQuotedPrintable;
begin
  enc := TIdEncoderQuotedPrintable.Create;
  edtOutput.Text := enc.Encode(edtInput.Text);
  enc.Free;
end;

I ran this example as both a Win32 and a .NET application. I tested with
the word "ATENÇÃO".

When I run this exemple as a Win32 app, the result I get from the
encoding is: "ATEN=C7=C3O" - That is exactly what I want, so I can send
my email.

But when I run this as a .NET app I get: "ATEN??O"

Why the same code gives different results? I need to get it to work with
.NET.

TIA,
Marcelo Siqueira

Replies