2

Outlook is causing some problems when being passed a mailto string with accented characters in it. Changing the codepage for my entire webpage that has this string on it solves this problem, but that causes other problems in the system, so I would not like to do that.

A string like such returns a lot of garbage characters:

"mailto:Helpdesk-someemail@email.com?subject=Mon bâtiment / Départementé / Bureau n'est pas répertorié"

Meanwhile, this cuts off the character after the "D"

"mailto:someemail@email.com?subject=Mon bâtiment / Départementé / Bureau n'est pas répertorié"

What gives? Is there no way to make this work? I am in Canada, so some regional issues might be taking effect here?

  • First sample works for me (pasted into chrome URL bar). Side note: Be aware that "Départementé" is not a french word "Département" is however. –  Nov 10 '09 at 14:53
  • First sample is not working when my keyboard settings are set to english canada, which is the default at my workplace. Thanks for the heads up on the department translation. The extra accented character got added during experimentation :) –  Nov 10 '09 at 15:12
  • Mixing Marcel Gosselin and Dan Fleet should lead you to the correct answer (but I have no way to try it out, so am not posting as such): explicitly encode your URL in UTF-8 (recommended by URL spec), then encode. – kdgregory Nov 10 '09 at 15:20
  • (substitute the last "encode" as "URL escape") – kdgregory Nov 10 '09 at 15:22
  • These concepts render all fine and dandy in most cases. However, it seems that outlook does some manipulation to this on its own, and it will not work with outlook. –  Nov 10 '09 at 15:24

2 Answers2

3

Maybe you can try this generator.

Basically, you need to use the hexadecimal value of the character in the page's encoding preceded by a percent sign. For UTF-8, your â is %C3%A2.

Marcel Gosselin
  • 4,610
  • 2
  • 31
  • 54
  • 1
    As a followup to Marcel's comment, look up "URL encoding" in your favourite search engine. mailto: is a URL protocol so should be subject to the same rules as e.g. an http: URL. – Dan Fleet Nov 10 '09 at 14:54
  • This unfortunately does the same thing. This is being reproduced on several machines. Even typing the above top link directly into firefox yields scary results in outlook. Note that my keyboard settings are set to english CANADA, so this may change the game. –  Nov 10 '09 at 15:11
  • 1
    I see what you mean, the subject in Outlook interprets the UTF-8 characters as Latin1. – Marcel Gosselin Nov 10 '09 at 15:26
  • Well, they look like `Mon bâtiment / Départementé / Bureau n'est pas répertorié`. I know for sure that `é` in UTF-8 converts to 2 bytes that when read as though they are latin-1 look like `é`. – Marcel Gosselin Nov 10 '09 at 15:54
  • Let's rephrase the above to make myself clear: The character `é` when written using TUF-8 encoding is two bytes. Those two bytes, if they are read as though they are Latin1 encoded characters look like `é`. – Marcel Gosselin Nov 10 '09 at 15:56
1

See the below link you will find the solution for your problem

try it Does C# have an equivalent to JavaScript's encodeURIComponent()?

Community
  • 1
  • 1
Snehal
  • 11
  • 1