Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pound sign £ showing as sqaure [] 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
is there a reason when I alert a messgage the pound sign is showing as a square?

cheers,

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Likely whatever font the alert box uses does not have a character for the Pound sing. I tried it in a Mac now and I got an accented capital A instead of the pound sign.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
hmmm...i tried this with:

Windows XP - IE7 / FF 3 / Chrome 2.0

and got the character to show up properly on all three

Code:
<script>
function showPound() {
alert("£");
}
</script>
<a href="javascript:showPound()">Show Pound</a>

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Well it used to show fine, is it an IE8 issue?

How do I change the font of an alert box is it relative to CSS fonts?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
I'm getting: "Â" In Firefox and Safari in Mac OSx


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
So what's happened?

I changed the CSS font family to
Code:
* {font-family: Arial, Helvetica, sans-serif;}

It made no difference I'm still getting a square?

And every PC has Arial, so it can't be a font thing can it?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
You can serve it (specifically targetted at the character alone) in utf-16 like this:
[tt] alert("This is sterling pound symbol: \u00a3");[/tt]
Otherwise, from the purely client-side perspective, the problem is the misalignment of [1] the encoding of source, [2] the guess of the browser about the encoding of the served text stream. Use of meta tag with charset specified may take away part of the uncertainty. But it still need to align with what the encoding the page is actually saved on the server. Without charset suggestion, it all depends on the caprice of browser's guessing routine. FF seems have better success.
 
I have a charset meta tag, along with DocType and it being X/HTML Strict 1.0

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

so it can't be that either can it?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
lol - then I spotted it... changed the charset to
Code:
charset=iso-8859-1
and all is well, probably copied the other setting from a USA page by mistake!

nice one tsuj!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top