tags:

views:

37

answers:

4

I am trying to insert a pound symbol into a plain text email using .net but it appears as £

Any ideas how I can fix this?

thanks

A: 

Depends how you're inserting it, but a couple of options are...

$ 

or

Convert.ToChar(35);
Garry
-1 `$' is ASCII 36 aka "dollar sign", 35 would be hash sign.
sleske
The first won't work in a plain text email (which the question specified), the second only works if the character encoding is specified correctly.
David Dorward
A: 

Make sure the declared character encoding of the email matches the character encoding you are actually using.

David Dorward
A: 

Well, this depends on the character encoding you use for sending out your plaintext mails.

Remember, there is no such thing as plaintext - you always need to use an encoding, and there are many to choose from :-).

If you use an encoding that has a pound sign (Unicode encodings do, ASCII e.g. does not), then just output it normally, and it should work.

P.S. Also see this excellent article:

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

sleske
A: 

The only way to get it working is to make sure you encode the email with the same character encoding as to what you decode it with. In this case, you are encoding the email in UTF-8 but decoding it as if it was Latin-1. It might be overkill for this case, but The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets is a good read.

One solution is to add Content-Type: text/plain; charset=UTF-8 as a header.

David Johnstone
thanks... add this as the header of what though?
Tom
Of the [email](http://en.wikipedia.org/wiki/Email#Message_format). I don't know ASP.net, but [this](http://www.4guysfromrolla.com/articles/101707-1.aspx) might help.
David Johnstone