WEFX
WEFX

Reputation: 8562

Euro currency symbol won't display, even though other symbols work

I'm sending data from one page to the next in an MVC2 app. Page 1 sends price information, and Page 2 displays a total w/ taxes. Using Fiddler, I can see my data being posted properly from Page 1 as such:

itemA_3225=Description&itemB_3225=123&itemCurrency_3225=USD&itemSymbol_3225=%24

Then, in the Post method of my Controller, I have this line:

mySymbol = Request.Form["itemSymbol_" + itemID].ToString();

and mySymbol gets updated properly as "$".

However, when I try doing this for Euros it doesn't work, even though everything else seems similar:

itemA_3226=Description&itemB_3226=123&itemCurrency_3226=EUR&itemSymbol_3226=%80

But in my Controller the mySymbol variable gets set to "". Any ideas? $ and £ work fine, but Euros and ƒ do not work.

Upvotes: 0

Views: 1382

Answers (2)

Mr Lister
Mr Lister

Reputation: 46579

Don't use %80 in the URI for a Euro symbol. The character set for the URI is always UTF-8, so you must send the character U+20AC, or, uuencoded, %E2%82%AC

Hope this helps!

Upvotes: 0

ControlAltDel
ControlAltDel

Reputation: 35011

IN my experience 90% of the time with errors like this the problem has to do with reading/writing with the wrong character set.

Upvotes: 1

Related Questions