Re: Problem with messagem encoding in DotNET applications

Giganews Newsgroups
Subject: Re: Problem with messagem encoding in DotNET applications
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Thu, 9 Mar 2006

"Marcelo Siqueira" <mdmsiqueira.GOAWAY-SP…@uol.com.br> wrote in message
news:6995FC1930F0E240mdmsiqueira.GOAWAY-SP…@uol.com.br...

> 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.

Strings are always Unicode in .NET, whereas they are Ansi in Win32.  Unicode
characters have to be encoded differently than Ansi characters.

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

The ? character indicate that the OS itself failed to translate a character
from Unicode to Ansi (or vice versa).

> Why the same code gives different results?

Because strings work differently in .NET than they do in Win32.

> I need to get it to work with .NET.

Why are you trying to encode strings manually in the first place?  You
should not be encoding the message manually at all.  Indy does that
automatically.  All you need to do in your own code is set the
ContentTransfer property to 'quoted-printable'.

Gambit

Replies

In response to

Problem with messagem encoding in DotNET applications posted by Marcelo Siqueira on Thu, 09 Mar 2006