在us-ascii中使用字符实体 [英] Using character entities in us-ascii

查看:104
本文介绍了在us-ascii中使用字符实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的文档中使用以下元标记:


< meta http-equiv =" Content-Type" content =

" text / html;字符集= US-ASCII" />


然后使用像& rsquo这样的字符实体;并且& mdash;


它在W3C和WDG上验证,并在Firefox 0.9中以标准兼容模式运行

。我想知道的是,这是一个好习惯吗?如果声明为使用

" us-ascii",那么
假设我的页面加载速度更快字符代码,但引用字符似乎很奇怪

实际上并不是ASCII字符代码。


顺便说一句,我还没弄明白告诉Apache使用

us-ascii用于我的所有页面,因为我认为这是'我应该用'/ b
而不是使用<元>标签。


Ian

-
http://www.bookstacks.org/

I''m using the following meta tag with my documents:

<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />

and yet using character entities like &rsquo; and &mdash;

It validates at W3C and WDG, and runs in standards compliance mode
in Firefox 0.9. What I''m wondering is, is this a good practice? I
assume my pages will load faster if declared as using the
"us-ascii" character code, but it seems odd to refer to characters
not actually in the ASCII character code.

As an aside, I have yet to figure out how to tell Apache to use
us-ascii for all my pages, as I assume that''s what I''m supposed to
do instead of using the <meta> tag.

Ian
--
http://www.bookstacks.org/

推荐答案

Ian写道:
我在我的文档中使用以下元标记:

< meta http-equiv =" Content-Type" content =
" text / html;字符集= US-ASCII" />

然后使用像& rsquo这样的字符实体;和& mdash;

< snip>但是在ASCII字符代码中引用字符实际上并不是很奇怪。


您要为此文档指定US-ASCII编码,但HTML作为

整体使用Unicode字符集(这有区别

字符集和编码之间的顺序)。如果Unicode的前128个字符与ASCII字符不同(它们不是),那么{将意味着

与真正的123字节不同文件。


如果你想要对编码和字符集进行基本的介绍,我会认为我的这篇Usenet帖子很不错:< http:/ /tinyurl.com/6dx4p>。

顺便说一下,我还没弄明白如何告诉Apache使用我们的所有页面的as-ascii,因为我认为''我应该做什么而不是使用< meta>标记。
I''m using the following meta tag with my documents:

<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />

and yet using character entities like &rsquo; and &mdash;

<snip> but it seems odd to refer to characters
not actually in the ASCII character code.
You''re specifying the US-ASCII encoding for this document, but HTML as a
whole uses the Unicode character set (there''s a difference between
character sets and encodings, by the way). If Unicode''s first 128
characters were different from ASCII''s (they aren''t), { would mean
something different from a real 123 byte in the document.

If you want a basic introduction to encodings and character sets, I
think this Usenet post of mine is decent: <http://tinyurl.com/6dx4p>.
As an aside, I have yet to figure out how to tell Apache to use
us-ascii for all my pages, as I assume that''s what I''m supposed to
do instead of using the <meta> tag.



http://www.w3.org/International/ques...access-charset


2004年7月26日星期一01:42:05 - 0400,Leif K-Brooks

< eu ***** @ ecritters.biz>写道:
On Mon, 26 Jul 2004 01:42:05 -0400, Leif K-Brooks
<eu*****@ecritters.biz> wrote:
您正在为此文档指定US-ASCII编码,但HTML作为整体使用Unicode字符集


好​​的,我想我明白了。我早期正在查看W3C字符

实体列表,看起来它显示的是HTML

4.01 DTD的一部分。命名实体正在转换为数字

Unicode。这最初是让我担心的,但我想我看到你的意思是什么。我一直认为一个角色实体代表

相当于你使用的任何编码,所以如果你声明

你使用的编码不支持那个角色

实体,它不会在浏览器中呈现。尽管如此,这似乎并不是b $ b。看起来字符实体通常是HTML的一部分,就像你可以使用& amp; amp;在XML文档中没有将它声明为实体的
,因为XML将其作为

的默认值。不过,我可能会走错路。

如果你想要对编码和字符集进行基本介绍,我认为我的这篇Usenet帖子很不错:< http:/ /tinyurl.com/6dx4p> ;.


谢谢。这就是我几个月来一直在寻找的东西。我认为唯一有用的另一件事是Jukka的一页。但是我认为

这个主题的某些方面非常明显,他们不会说明。例如,知道

& #number; (因为我的术语很糟糕:),如果它低于

255,那么在ASCII,ISO 8859-n或UTF-8(I

想)。知道US-ASCII是人们用ASCII表示的b $ b的含义,以及类似的东西也是有帮助的。我甚至可能有这些错误,但是他们似乎没有得到解决,或者至少很难找到有关此类信息的b $ b。我认为这是一个重要的

主题,特别是如果

编码从UTF-8切换到US-ASCII,那么页面加载速度更快。
http://www.w3.org /International/ques...access-charset
You''re specifying the US-ASCII encoding for this document, but HTML as a
whole uses the Unicode character set
Okay, I think I get it. I was looking at the W3C list of character
entities early, which looked like it was showing part of the HTML
4.01 DTD. The named entities were being converted into numeric
Unicode. This was initially what worried me, but I think I see
what you mean. I always thought a character entity "stood for" the
equivalent in whatever encoding you''re using, so if you state
you''re using an encoding that doesn''t support that character
entity, it wouldn''t get rendered in the browser. This doesn''t seem
to be the case, though. It looks like character entities are part
of HTML in general, just like you can use &amp; in an XML document
without declaring it as an entity, since XML has that as a
default. I may be on the wrong track here, though.
If you want a basic introduction to encodings and character sets, I
think this Usenet post of mine is decent: <http://tinyurl.com/6dx4p>.
Thank you. That''s what I''ve been looking for for months. The only
other thing I found useful was a page by Jukka. But I think
there''s some aspects of this subject that are so obvious they
don''t get stated. It''s helpful, for instance, to know that
&#number; (since I''m bad with the terminology :), if it''s below
255, will be the same thing in ASCII, ISO 8859-n, or UTF-8 (I
think). It''s also helpful to know that US-ASCII is what people
mean by ASCII, and stuff like that. I may even have these wrong,
but they don''t seem to get addressed, or at least it''s hard to
find information about stuff like this. I think it''s an important
topic, especially if it''s true that pages load faster if the
encoding is switched from UTF-8 to US-ASCII.
http://www.w3.org/International/ques...access-charset




哦,伙计。它只是.htaccess,是吗? :-)


Ian

-
http://www.bookstacks.org/


" Ian" < BL *** @ blank.com>一个écritdansle message de

新闻:0a ******************************** @ 4ax.com
"Ian" <bl***@blank.com> a écrit dans le message de
news:0a********************************@4ax.com
我认为如果声明使用
us-ascii,我的页面加载速度会更快。字符代码
I assume my pages will load faster if declared as using the
"us-ascii" character code




为什么这么认为?我无法理解为什么它会是真的,并且永远不会在b
看到不同编码的页面之间的加载时间有任何差异。



Why do you think that ? I can''t figure why it would be true, and never could
see any difference in loading time between pages with different encodings.

这篇关于在us-ascii中使用字符实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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