Link to home
Start Free TrialLog in
Avatar of Gezna
Gezna

asked on

mailto and french accents

I am having trouble with the mailto: function. If I use french accents whent the email actually comes up, there are strange characters in place of the accents. Should I be using other characters to represent the accents? If so what are they?

            Dim subject As String = "é à è ê ç É À È Ê, etc."
            Dim body As String = "é à è ê ç É À È Ê, etc."
            lnkEmail.NavigateUrl = "mailto:?Subject=" & subject & "&Body=" & body

Thanks,
Avatar of _TAD_
_TAD_



Do the email addresses have accents in them?

Like this:
aàbbcc@Home.Com

If the deliverable email addresses are suppose to have accents, then I think you need to change use the globalization namespace and change your country code from en-US to something that will understand the french letters.

You other alternative is to change the text from ASCII to UTF-8 or unicode.

What it reall boils down to is that the first 128 characters are control characters or English based characters and punctuation.  The extended characters depends on which text format or country code you use.  
ASKER CERTIFIED SOLUTION
Avatar of chinhdo1
chinhdo1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gezna

ASKER

This worked great! Can you explain what the codepage attribute is for me please? Are there others, or any other problems this attribute may solve/cause?
Gezna, I am not sure if I can explain precisely why setting charset/codepage fixes the problem but I'll try with what I know.

By default, ASP.NET uses UTF-8 as the charset (16-bit characters). When you click on a "mailto" hyperlink, the email data on the page is picked up by the browser and passed to the default email application. So, either IE or Outlook (this combo is what I have on my PC) is not set up to deal with Unicode characters from a mailto hyperlink. I am not surprised at this behaviour... many Windows apps either do not support Unicode or support it only partially. For example, in Outlook, you can type Unicode characters in the message body but not in the Subject line.

When you specify a codepage such as 1252 (Western European), I think the characters are encoded as 8-bit characters and therefore are dealt with properly.

The only problem I can think of with using non-UTF charset is that you won't be able to display the entire UTF range of characters (chinese, japanese, hebrew, etc.) on your page. It should not be a problem at all for Frech characters, which are found within the 256 characters of the 1252 codepage.