Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I display a pound (£) symbol in HTML?

I'm trying to display the pound symbol in HTML (from PHP) but all I get is a symbol with a question mark.

The following are things that I've tried.

In PHP:

header('Content-type: text/html; charset=utf-8'); 

In HTML, put this in the head tag:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  

I tried displaying it using a javascript function which converts it to:

&amp;#65533; 

I suppose it would help if I knew what I was doing... but I guess that's why I'm asking this question :)

like image 896
Stephen Oberauer Avatar asked Dec 07 '10 22:12

Stephen Oberauer


People also ask

How do I display the pound sign?

Inserting the pound symbol using an Alt keyboard shortcutPress and hold Alt + 0163 or Alt + 156 on the numeric keypad.

What is the Ascii code for pound sign?

http://www.ascii-code.com/ Says A3 = 163 is the ASCII value of the pound sign.

How do I print the HTML symbol?

When you want to insert a special character, select Insert > HTML > Special Characters. From there are you presented with a few of the most common, or you can choose “Other” to view all the characters available. Simply select the character you would like to insert and the code is inserted for you.


1 Answers

Educated guess: You have a ISO-8859-1 encoded pound sign in a UTF-8 encoded page.

Make sure your data is in the right encoding and everything will work fine.

like image 137
Pekka Avatar answered Sep 24 '22 10:09

Pekka