Login  
Search All Forums
Dart Home | PowerTCP Mail for ActiveX | Custom Development Reply | PowerTCP Mail for ActiveX Topics | Forums   
AuthorForum: PowerTCP Mail for ActiveX
Topic: UTF8 vs. UTF-8
mhp

From: new york, NY USA
Posts: 47
Member Since: 04/24/02
posted January 23, 2004 6:18 PM

Using the smtp control, if you do

smtp.message.addtext sUTF8Message, "UTF8"

it encodes the message properly. but the content-type is set to "UTF8" which mail programs do not recognize as being equal to UTF-8. If you then manually change the encoding in your mail program it will display correctly.

but if you do

smtp.message.addText sUTF8Message, "UTF-8"

the message is sent encoded INcorrectly. the content-type is now UTF-8 but the bytes are way wrong. Any workarounds to this? Or can you change the code that looks for the content-type to accept UTF-8 where it currently accepts UTF8?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 26, 2004 9:10 AM

There is no encoding done using the AddText method. It's up to you to assure the the text you add is properly encoded with the charset that you specified.

spolsky

From: New York, NY USA
Posts: 1
Member Since: 01/26/04
posted January 26, 2004 9:12 PM

Hi Tony!

I work with Michael (mhp). We are actually encoding the message ourselves as UTF-8 using a utility function of our own that converts to UTF-8.

When we call AddText with "UTF8" the message is sent correctly, although Dart adds a header which says "charset="UTF8"" which the mail user agent (Outlook) does not recognize and so Outlook guesses, incorrectly, that the message is encoded using Latin 1 which comes out wrong.

When we call AddText with "UTF-8" and no other changes, the message is NOT sent correctly. Every character is converted to ?. Although Dart adds a header which says "charset="UTF-8"", so Outlook knows that it's a message encoded in UTF-8, but the bytes of the message are messed up in some way so the whole message consists of question marks.

I do not know what really happens with that second argument internally to Dart... it does seem like when we use "UTF-8" somebody somewhere tries to do some kind of encoding or decoding which messes up the message, and we don't understand what it is.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 26, 2004 10:12 PM

Please make a sample program that we can run here. Make sure that you include the encoded UTF. After you create the message, use Message.Store to store the file as "utfmessage.eml"

Ideally I should just be able to press a button and the message should be created.

Please zip up the source and email it to support@dart.com

Reply | PowerTCP Mail for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX