£ symbol display as a square?
When I enter a £ sign into an iRite field, save it and then view that content on a web page, the pound sign displays as a square symbol.
Is that something I'm doing wrong, or is it a bug in the old iRite?
Thank you.
NJ
When I enter a £ sign into an iRite field, save it and then view that content on a web page, the pound sign displays as a square symbol.
Is that something I'm doing wrong, or is it a bug in the old iRite?
Thank you.
NJ
Make sure your pages are set to use the utf-8 character set:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
you may also need to edit the connection to use the utf-8 character set, for example, a connection named localhost will have the following at line 9 of the Connections/localhost.php file:
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
change that to:
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_set_charset('utf8',$localhost);
Oops....me bad. It's me.
Classic ASP.
I tried this...
<script type="text/vbscript">
poundsign="<%=(rsPROPERTY.Fields.Item("SWPCdesc").Value)%>"
document.write(Replace(poundsign,"£","£"))
</script>
But whilst it didn't produce an error, it didn't solve the issue.
Thanks Jason.
NJ
if you look directly in the database, is the pound sign stored correctly?
if it stored in the DB correctly, then the problem is most likely the page's character set:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
I have the character set as you have described:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
...but I'm still seeing squares for pound signs or, even more strangely, black diamonds with a question mark in the middle:
http://www.nathonjones.com/swpc/property-estate-agents-scotland.asp?SWPC=292 (squares)
http://www.nathonjones.com/swpc/property-lets-rented-accommodation.asp?SWPC=467 (diamonds with question mark)
This text is being fed from a field in an MSSQL database table.
Hope someone can spot the glaring error. Thank you.
Regards
NJ
Look in the database directly, how is it stored in the database? does it look right if you look at in the database?
try encoding the character in the database so that it is stored as:
€
The pound sign looks fine in the database. To say I'm confused would be an understatement because I've been working with MSSQL and Classic ASP for a long time and have never encountered this.
I'm using the iRite extension to allow the user to input a description, which often includes a pound sign. How do I get iRite to convert the pound sign to the encoded value you've recommended?
I can't use Server.HTMLEncode either because the description includes <p> </p> tags.
I checked the page against W3C validation and, sure enough, there is an error reported related to utf-8:
"Sorry, I am unable to validate this document because on line 302 it contained one or more bytes that I cannot interpret as utf-8 (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: utf8 "\xA3" does not map to Unicode"
Line 302 is...
<h3><%IF (rsPROPERTY.Fields.Item("SWPCadd").Value) <> "" Then%><%=(rsPROPERTY.Fields.Item("SWPCadd").Value)%>, <%End IF%><%=(rsPROPERTY.Fields.Item("SWPCtown").Value)%>. <%=(rsPROPERTY.Fields.Item("SWPCpostcode").Value)%></h3>
Man I'm confused!
Appreciate the help. Thank you.
Regards
NJ
I'll need to troubleshoot directly, see the private message section.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.