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
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
Depends how you're inserting it, but a couple of options are...
$
or
Convert.ToChar(35);
Make sure the declared character encoding of the email matches the character encoding you are actually using.
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 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.