Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
379 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...