Link to home
Create AccountLog in
Avatar of tingleweb
tinglewebFlag for United Kingdom of Great Britain and Northern Ireland

asked on

formatcurrency showing invalid character symbol instead of pound sign

i've got this code:
--------------------------------------------------------------------------------------------

      display = display + "<div id=""productsProductOuterContainer"">"
      display = display + "<div id=""productsProductContainer"">"

      display = display + "<div class=""productImageContainer""><a href=""product.asp?ProductID=" + ProductID + "&ProductName=" + ProductName + "&Department=" + dept + "&menswomens=" + category + """><img src=""images/md/" + ProductImage + ".jpg"" class=""productimages"" alt=""" + ProductName + """/></a></div>"
      display = display + "<p>" + ProductName + "<br />" + formatcurrency(ProductPricerrp) + "</p>"
      display = display + "<a href=""product.asp?ProductID=" + ProductID + "&ProductName=" + ProductName + "&Department=" + dept + "&menswomens=" + category + """><img src=""images/" + session("menswomens") + "bt_view.gif"" alt=""View"" /></a>"

      display = display + "</div>      <!-- end of productsproductcontainer -->"
      display = display + "</div>"


   response.write(display)
--------------------------------------------------------------------------------------------

but instead of formatcurrency(ProductPricerrp) showing £ before the price, its showing an invalid character symbol (square).  Any ideas please?  
Avatar of kevp75
kevp75
Flag of United States of America image

you will probably have to change the codepage of the page in question to be uk.  I know the server may be located in europe, however it may have been configured to be us, or some other country
another thing that may do it, the DTD you use
Avatar of b0lsc0tt
Besides the above look at the encoding for the page.  This can be done with an html meta tag but is even better from the server.  In ASP it would be done with ...

Response.AddHeader "Content-type", "text/html; charset=utf-8"

You could use a different encoding but utf-8 is one that should support that symbol.

Let me know if you have a question or need more info.

bol
One other thought and maybe the simplest solution if it is an encoding issue.  Use HTMLEncode.

   response.write(Server.HTMLEncode((display))

bol
ASKER CERTIFIED SOLUTION
Avatar of tingleweb
tingleweb
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of modus_operandi
modus_operandi

Closed, 500 points refunded.
modus_operandi
Community Support Moderator