命名与数字实体 [英] Named vs. numerical entities

查看:45
本文介绍了命名与数字实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在某处读到了声称数字实体(例如

- )比同等命名实体具有速度优势

(例如& mdash;)因为数字实体只需要将一个

字节下载到浏览器,而命名实体需要每个字母一个字节
。 (所以在这种情况下,它可能是一个

字节而不是七个字节。)我发现这个声明有点令人惊讶 - 我想b $ b会想到*每个*数字实体中的数字需要

一个字节。 Web服务器是否真的发送整个数字实体

作为单个...字符或其他...我甚至不知道如何表达

这个问题正确!


此外,哪种形式的实体享有更广泛的浏览器支持?他们两个

似乎与现代浏览器一起工作......但是那些旧版或非常错误的

浏览器呢?

I recently read the claim somewhere that numerical entities (such as
—) have a speed advantage over the equivalent named entities
(such as —) because the numerical entity requires just a single
byte to be downloaded to the browser, while the named entity requires
one byte for each letter. (So in this case, it would presumably be one
byte vs. seven bytes.) I found this claim a little surprising -- I
would have thought *each* numeral in the numerical entity would require
one byte. Does the Web server really send the entire numerical entity
as a single... character or whatever... I don''t even know how to phrase
this question correctly!

Also, which form of the entity enjoys wider browser support? They both
seem to work with modern browsers... but what about older or very buggy
browsers?

推荐答案

Jonas Smithson写道:
Jonas Smithson wrote:
我最近在某处读到了数字实体(例如 - )比同等命名的
实体具有速度优势的说法(例如& mdash;)因为数字实体只需要将一个字节下载到浏览器,而命名的
实体每个字母需要一个字节。


我的,这是你被告知的poppycock负载。

我发现这个声明有点令人惊讶


那太好了。

我原本以为*数字实体中的每个*数字都需要一个字节。


这取决于编码。如果你想要了解更多信息,你最好咨询指南。我希望我能更好地理解这一切。我不是,尽管

阅读**来自这里非常精通的人们的大量**帖子。

如果你有兴趣,谷歌小组对于Alan Flavell编码或者

Andreas Prilop charset。那会发现很多帖子。我建议你仔细阅读他们所说的话。阅读那些与他们争论的人,至少在字符编码问题上花了很多钱。

此外,哪种形式的实体享有更广泛的浏览器支持?它们似乎都适用于现代浏览器...但是那些旧的或者非常错误的浏览器呢?
I recently read the claim somewhere that numerical entities (such
as —) have a speed advantage over the equivalent named
entities (such as —) because the numerical entity requires
just a single byte to be downloaded to the browser, while the named
entity requires one byte for each letter.
My, that was a load of poppycock you were told.
I found this claim a little surprising
That''s being too kind.
I would have thought *each* numeral in the numerical entity would
require one byte.
That depends on the encoding. You''d best consult the guides if you
want to know more. I wish I understood it all better. I don''t, despite
reading **numerous** posts from folks here who are quite well-versed.
If you''re interested, Google the group for "Alan Flavell encoding" or
"Andreas Prilop charset". That''ll turn up lots of posts. I''d suggest
you read what they say carefully; read those who argue with them, at
least on character encoding issues, with a grain of salt.
Also, which form of the entity enjoys wider browser support? They
both seem to work with modern browsers... but what about older or
very buggy browsers?




再次,A. Flavell是你的男人支持自己阅读重读:

http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist

-

Brian(删除.invalid给我发电子邮件)
http://www.tsmchughs.com /


" Jonas Smithson" < SM ************ @ REMOVETHISboardermail.com>写在

comp.infosystems。 www.authoring.html:
"Jonas Smithson" <sm************@REMOVETHISboardermail.com> wrote in
comp.infosystems.www.authoring.html:
我最近在某处读到了数字实体(例如
- )比同等命名实体(例如& mdash;)具有速度优势的声明,因为数字实体只需要将一个
字节下载到浏览器,而命名实体需要每个字母一个字节。 (所以在这种情况下,它可能是一个字节对七个字节。)我发现这个说法有点令人惊讶 - 我会想到*数字实体中的每个*数字都需要
一个字节。
I recently read the claim somewhere that numerical entities (such as
—) have a speed advantage over the equivalent named entities
(such as &mdash;) because the numerical entity requires just a single
byte to be downloaded to the browser, while the named entity requires
one byte for each letter. (So in this case, it would presumably be one
byte vs. seven bytes.) I found this claim a little surprising -- I
would have thought *each* numeral in the numerical entity would require
one byte.




确实如此。


如果您真正创建文档,那么差异就会出现Unicode中的
而不是8位字符集。如果文件是实际用Unicode编写的
,并用Unicode传输,那么

是实际8212字符的一个优点,因为它只需要

两个字节,而& mdash;是7个字符。 (我不记得是否

'是7 * 2 = 14个字节或者某些压缩是否会继续,但它肯定是
超过2个字节。)


-

Stan Brown,Oak Road Systems,美国纽约汤普金斯县
http://OakRoadSystems.com/

HTML 4.01规范: http://www.w3.org/TR/html401/

验证人: http://validator.w3.org/

CSS 2规范: http://www.w3.org/TR/REC- CSS2 /

2.1更改: http://www.w3.org/TR/CSS21/changes.html

验证者: http:// jig saw.w3.org/css-validator/



It does.

Where the difference arises is if you actually create your document
in Unicode instead of an 8-bit character set. If the document is
actually composed in Unicode, and transmitted in Unicode, then there
is an advantage of the actual 8212 character because it needs only
two bytes whereas &mdash; is 7 characters. (I can''t remember whether
that''s 7*2=14 bytes or some compression goes on, but it''s certainly
more than 2 bytes.)

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/


Jonas Smithson写道:
Jonas Smithson wrote:
我最近阅读了索赔在某个地方,数字实体(例如 - )比同等命名的
实体(例如& mdash;)具有速度优势,因为数字实体只需要下载一个字节到浏览器,而命名的
实体每个字母需要一个字节。 (所以在这种情况下,它可能是一个字节而不是七个字节。)
I recently read the claim somewhere that numerical entities (such
as —) have a speed advantage over the equivalent named
entities (such as &mdash;) because the numerical entity requires
just a single byte to be downloaded to the browser, while the named
entity requires one byte for each letter. (So in this case, it
would presumably be one byte vs. seven bytes.)




顺便说一句,你读过的工作的人确实声称那里

在2个文件中会有明显的差异,其中文件(a)

比文件(b)多6个(或12个,或几个,甚至60个)字节)?


-

Brian(删除.invalid给我发电子邮件)
http://www.tsmchughs.com/


这篇关于命名与数字实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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