为什么我不能在HTML中显示英镑(£)符号? [英] Why can't I display a pound (£) symbol in HTML?

查看:585
本文介绍了为什么我不能在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:

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

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆