为什么HTML十进制和HTML十六进制? [英] Why HTML decimal and HTML hex?

查看:198
本文介绍了为什么HTML十进制和HTML十六进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试Google了一段时间了,为什么HTML实体可以用HTML十进制或HTML十六进制编译。因此,我的问题是:


  • HTML十进制和HTML十六进制之间的区别是什么?

  • 有两种系统可以做同样的事情吗?
  • 最初,HTML名义上是基于SGML,只有十进制字符引用。后来,十六进制的替代方法是在HTML 4.01中添加了 (并很快在浏览器中实现),然后在 Web适配附件中改进为SGML。



    添加十六进制替代方法的主要原因是,所有现代字符代码和编码标准(如Unicode)都使用十六进制符号表示字符代码数。通过Unicode编号引用字符的能力,用传统的十六进制表示法,前缀为& #x ,后缀为; ,有助于避免人们从十六进制转换为十进制符号时可能出现的错误。


    I have tried to Google quite a while now for an answer why HTML entities can be compiled either in HTML decimal or HTML hex. So my questions are:

    • What is the difference between HTML decimal and HTML hex?
    • Why are there two systems to do the same thing?

    解决方案

    Originally, HTML was nominally based on SGML, which has decimal character references only. Later, the hexadecimal alternative was added in HTML 4.01 (and soon implemented in browsers), then retrofitted into SGML in the Web Adaptations Annex.

    The apparent main reason for adding the hexadecimal alternative was that all modern character code and encoding standards, such as Unicode, use hexadecimal notation for the code numbers of characters. The ability to refer to a character by its Unicode number, written in the conventional hexadecimal notation, just prefixed with &#x and suffixed with ;, helps to avoid errors that may arise if people convert from hexadecimal to decimal notation.

    这篇关于为什么HTML十进制和HTML十六进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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