为什么我不能在HTML中显示英镑(£)符号? [英] Why can't I display a pound (£) symbol in HTML?
问题描述
我试图在HTML中显示英镑符号(来自PHP),但我得到的是带有问号的符号。
以下是在PHP中:
header(' Content-type:text / html; charset = utf-8');
在HTML中,将它放在head标签中:
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8/>
我尝试使用JavaScript函数将其转换为:
& amp; amp; amp; amp;#65533;
我想如果我知道自己在做什么会有所帮助......但我想这就是为什么我'问这个问题:)
受过教育的猜测:你有一个ISO-8859-1编码的英镑符号UTF- 8编码页面。
请确保您的数据使用正确的编码,并且一切正常。
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:
&#65533;
I suppose it would help if I knew what I was doing... but I guess that's why I'm asking this question :)
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.
这篇关于为什么我不能在HTML中显示英镑(£)符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!