将摄氏度标志编码到网页中的最佳方法是什么? [英] Best way to encode Degree Celsius symbol into web page?
问题描述
我应该如何将特殊字符编码到网页中?例如,我需要这个符号℃,我只是通过复制和粘贴角色,因为我现在可以看到它。这适用于我检查过的桌面浏览器以及iPad和iPhone,但是我用于测试的黑莓手机上没有显示任何内容。有没有一个标准的最佳做法呢?
http: //www.fileformat.info/info/unicode/char/2103/browsertest.htm
尝试按照Martin的建议,将它替换为& deg;
,并将字符集设置为utf-8。 $ b
& deg; C
会得到如下所示的结果:
How should I encode special characters into web pages? For instance I need this symbol ℃, which I used just by copying and pasting the character as I can see it now. This worked for the desktop browsers I checked with and also on iPad and iPhone but nothing is displayed on a Blackberry I used for testing. Is there a standard best practice for this?
http://www.fileformat.info/info/unicode/char/2103/browsertest.htm
Try to replace it with °
, and also to set the charset to utf-8, as Martin suggests.
°C
will get you something like this:
这篇关于将摄氏度标志编码到网页中的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!