Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending UTF-8 emails using CDO2000
Message
 
To
13/08/2021 05:57:03
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01681865
Message ID:
01682231
Views:
104
Ah ok, I'm showing my own ignorance about punnycode.

The problem here is not Unicode conversion but specifically the domain name which in the past it was not valid to use upper ascii characters in.

I see you're already converting to punnycode (I'd never actually heard of that until I looked it up), you still need a library that actually supports that. COM based CDO probably doesn't because it's old... IOW, the failure is not for the character conversions but due what the library sees as an invalid domain name.

Hard to test unless you actually have a mail server that runs on a domain with that. I guess setting up a local domain in HOSTS then testing with something like Papercut would work to test... Now curious if this works in the .NET Mail client used by wwSMTP.

FWIW, I just played around with a few different thing using umlauts in domain names, and this seems like an extraordinarily **bad idea** to have a domain name with extended characters in it as a lot of things don't work.

On Windows IIS won't properly bind a domain mapping to an umlaut domain, and my local mail test software also won't do it. With some more checking I see that Windows in general has problems resolving these extended domain names. If I have a local domain name like `bär.west-wind.com` in my HOSTS file, ping or tracert won't resolve it but change it to `baer.west-wind.com` it works fine.

Looks like wwSMTP (.NET and also the older raw WinSockets version) also fails with the extended domain name and I get an error: Domain name `bär.west-wind.com` can't be resolved. So no go on that either...

As said, domain names that use extended characters are bound to cause problems on many levels. Even Asian Web sites use latin letters for domain names for example, and I can't think of a single Web site that uses extended characters for its name...

+++ Rick ---

>Hi!
>
>>> >Because you have national characters in domain name, then smtp adress must use punnycode:
>>
>>That really shouldn't be necessary. When calling COM objects from FoxPro as the ANSI FoxPro COM Interop APIs automatically convert strings to Unicode.
>
>domain name needs converted to punnycode. Using special conversion in code to punnycode as Martina posts it worked.
>It looks like CDO does not perform this conversion.
>
>>And that should work **as long as the active CodePage supports the characters it's trying to assign**. >If the string has values that are not valid for the current CodePage the input is hosed before it ever >goes to COM. If you are in a Russian CodePage I don't think the Western Umlauts are valid and if >printed would print `?`.
>
>I'm in windows-1257 (Baltic) code page. Accented characters from this page in e-mail body and subject work OK without specifiying UTF conversion.
>Only accented domain name has the issue.
>
>>It's hard to say based on the original description that Andrus posted but it sounds to me he's running in a non-Western Code page and trying to send Western characters, which simply won't work unless you switch code pages and convert to binary strings or UTF-8.
>
>I'm in Windows 1257 code page and sending characters which are valid in this page.
>
>Andrus.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform