×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

pound sign £ showing as sqaure []

pound sign £ showing as sqaure []

pound sign £ showing as sqaure []

(OP)
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!"

RE: pound sign £ showing as sqaure []

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.  

RE: pound sign £ showing as sqaure []

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: http://www.google.com/webhp?complete=1&hl=en
--------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc

RE: pound sign £ showing as sqaure []

Hi

Must be a font problem, as Phil wrote. On my Linux also appears correctly. ( FireFox, SeaMonkey, Epiphany, Galeon, Opera, Midori, Arora, Konqueror. )

Feherke.
http://rootshell.be/~feherke/

RE: pound sign £ showing as sqaure []

(OP)
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!"

RE: pound sign £ showing as sqaure []

Hi,

I just tried your code on IE8 running on Windows XP SP3 and it worked fine for me.

Regards,

Martin

Computing Design And Services:
http://www.webrevolt.biz

RE: pound sign £ showing as sqaure []

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.  

RE: pound sign £ showing as sqaure []

(OP)
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!"

RE: pound sign £ showing as sqaure []

You can serve it (specifically targetted at the character alone) in utf-16 like this:
    alert("This is sterling pound symbol: \u00a3");
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.

RE: pound sign £ showing as sqaure []

(OP)
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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!"

RE: pound sign £ showing as sqaure []

(OP)
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!"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close