将摄氏度标志编码到网页中的最佳方法是什么? [英] Best way to encode Degree Celsius symbol into web page?

查看:117
本文介绍了将摄氏度标志编码到网页中的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何将特殊字符编码到网页中?例如,我需要这个符号℃,我只是通过复制和粘贴角色,因为我现在可以看到它。这适用于我检查过的桌面浏览器以及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屋!

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