包装或不包装“C ++”? [英] To wrap or not to wrap "C++"?

查看:66
本文介绍了包装或不包装“C ++”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当包装

字C ++时,有人能告诉我Opera 9.5的行为是否正确,例如:


C +

+


Opera 9.2没有包装C ++。对于那些使用Opera 9.5的人,在
的情况> http://www.highscore.de/browsertest/cpp.html
(尝试不同的窗口

尺寸,直到Opera 9.5包装C ++)。


鲍里斯

Can anyone tell me if Opera 9.5 is behaving correctly when wrapping the
word C++, eg:

C+
+

Opera 9.2 didn''t wrap C++. For those who use Opera 9.5 there is a test
case at http://www.highscore.de/browsertest/cpp.html (try different window
sizes until Opera 9.5 wraps C++).

Boris

推荐答案

Boris schrieb am 13.09.2008 16:23:
Boris schrieb am 13.09.2008 16:23:

任何人都可以告诉我,当包装

字C ++时,Opera 9.5的行为是否正确,例如:


C +

+
Can anyone tell me if Opera 9.5 is behaving correctly when wrapping the
word C++, eg:

C+
+



Opera 9.6每周测试版包装

C

++



C +

+


版本9.60 beta

Build 10427

Plattform Win32

Betriebssystem Windows XP

Opera 9.6 Weekly beta wraps
C
++
and
C+
+

Version 9.60 beta
Build 10427
Plattform Win32
Betriebssystem Windows XP


Opera 9.2没有包装C ++。对于那些使用Opera 9.5的人,在
的情况> http://www.highscore.de/browsertest/cpp.html
(尝试不同的窗口

大小,直到Opera 9.5包装C ++)。
Opera 9.2 didn''t wrap C++. For those who use Opera 9.5 there is a test
case at http://www.highscore.de/browsertest/cpp.html (try different window
sizes until Opera 9.5 wraps C++).



-

MitfreundlichenGrü?en

Holger Jeromin

--
Mit freundlichen Grü?en
Holger Jeromin


2008-09-13,Boris< bo **** @ web.dewrote:
On 2008-09-13, Boris <bo****@web.dewrote:

任何人都可以告诉我,如果Opera 9.5是包裹

字C ++时表现正确,例如:


C +

+
Can anyone tell me if Opera 9.5 is behaving correctly when wrapping the
word C++, eg:

C+
+



定义所有这些的规范是Unicode标准附件#14。


浏览器不必遵循该规范声称它们支持

HTML和/或CSS,但它是支持大量

世界语言的最简单方法。


从技术上讲,Opera几乎无论它做什么都是正确的,但它看起来好像他们基本上都在执行Unicode规则。


你可以自己阅读附件14:<​​br />
http://unicode.org/reports/tr14/


它的长短是+具有破线类公关

或前缀所以它被视为货币符号。


现在,我认为这意味着默认情况下你不能打破C +或+ C,

基于PR的定义。


不确定它们的含义是什么意思默认情况下。我没看完整个规格。


但是如果你看看7.3节中的配对表,那就说你可以在b $ b之间打破C +" (和++)但不在+ C之间,这正是Opera所做的b
。 (C类是AL - 字母或类似的东西。

通过''中断'C +'''我的意思是在和之间断开; C"和+。


Korpela就是这方面的专家。


如果你想阻止包装,因为毕竟C ++是一个特殊用途

的+,使用white-space:nowrap。

The specification that defines all this is Unicode Standard Annex #14.

Browsers don''t have to follow that specification to claim they support
HTML and/or CSS, but it''s the easiest way to support a large number of
world languages.

So technically, Opera is correct pretty much whatever it does, but it
looks like they are basically doing the Unicode rules.

You can read Annex 14 for yourself:

http://unicode.org/reports/tr14/

The long and short of it is that "+" has the "Line breaking class" of PR
or "Prefix" so it''s treated a bit like a currency symbol.

Now, I think that means that "by default" you can''t break "C+" or "+C",
based on the definition of PR.

Not sure what they mean by "by default". I haven''t read the whole spec.

But if you look at the pair table in section 7.3, that says you can
break between "C+" (and "++") but not between "+C", which is just what
Opera is doing. (The class of "C" is "AL"-- "alphabetic" or something).
By ''break between "C+"'' I mean break between the "C" and the "+".

Korpela is the expert on this kind of thing.

If you want to prevent wrapping, because after all C++ is a special use
of "+", use white-space: nowrap.


Opera 9.2 didn''包装C ++。对于那些使用Opera 9.5的人,在
的情况> http://www.highscore.de/browsertest/cpp.html
(尝试不同的

窗口大小,直到Opera 9.5包装C ++)。
Opera 9.2 didn''t wrap C++. For those who use Opera 9.5 there is a test
case at http://www.highscore.de/browsertest/cpp.html (try different
window sizes until Opera 9.5 wraps C++).



有可能他们一直在改进对世界语言的支持

,从而加强了他们对Unicode的一致性断线

方法。

It''s possible they''ve been improving their support for world languages
and so sharpened up the Unicode-conformance of their line-breaking
method.


Ben C写道:
Ben C wrote:

2008年-09-13,Boris< bo **** @ web.dewrote:
On 2008-09-13, Boris <bo****@web.dewrote:

>任何人都可以告诉我,当包装时,Opera 9.5是否表现正常/> C ++这个词,例如:

C +
+
>Can anyone tell me if Opera 9.5 is behaving correctly when wrapping
the word C++, eg:

C+
+



定义所有这些的规范是Unicode标准附件#14 。


The specification that defines all this is Unicode Standard Annex #14.



不是真的。

Not really.


浏览器不必遵循该规范声称他们支持

HTML和/或CSS,
Browsers don''t have to follow that specification to claim they support
HTML and/or CSS,



因此,UAX#14确实_not_定义行为是否正确。


HTML(或CSS)规范不要求符合Unicode

标准。 (他们用它来定义东西,或者更确切地说它的部分

相当于ISO 10646,但这是一个不同的问题。)此外,UAX#14,

虽然是部分除了一些部分之外,标准的规范并不规范,所以即使Opera声称符合Unicode一致性,它也可以包装C ++,正式说来。

正式发言。 />

Thus, UAX #14 does _not_ define whether the behavior is correct or not.

HTML (or CSS) specifications do not require conformance to the Unicode
Standard. (They define things in terms of it, or rather its partial
equivalent ISO 10646, but that''s a different issue.) Moreover, UAX #14,
though part of the standard, is not normative except for a few parts, so
even if Opera claimed Unicode conformance, it could wrap C++ as it likes,
formally speaking.


但它是支持大量

世界语言的最简单方法。
but it''s the easiest way to support a large number of
world languages.



我不同意;请参阅 http://www.cs.tut.fi/某些

参数的~jkorpela / unicode / linebr.html
。 UAX#14非常混乱,基本上试图处理

_general_断线原则。然而它的规则通常非常粗糙,

要么阻止完全可接受的换行符,要么(更经常地)允许

愚蠢的换行符。我会说这不是很有用,除非在

特殊情况下你_must_在一个地方打破一个字符串而没有

更好的指导方针。不幸的是,网页浏览器已经开始实施越来越多的UAX#14部分(虽然仍然不是很多,而且b / b从未真正保持一致)。将空格仅视为空格的原则通常可以更好地使用,但它自然会因为不使用单词之间的空格而使用b / b $ b语言 - 但这样的问题应该以不同的方式解决

I disagree; see http://www.cs.tut.fi/~jkorpela/unicode/linebr.html for some
arguments. UAX #14 is quite a mess and basically tries to deal with
_general_ principles of line breaking. Yet its rules are often very coarse,
either preventing completely acceptable line breaks or (more often) allowing
foolish line breaks. I would say that it''s not very useful except in
exceptional situations where you _must_ break a string somewhere and have no
better guidelines. Unfortunately, web browsers have started implementing
parts of UAX #14 to an increasing amount (though still not very much and
never really consistently). The old principle of treating only whitespace as
allowable break point generally works better, though it naturally fails for
language that don''t use whitespace between words - but such problems should
be solved in a different way.


它的长短是+。具有破线类

PR或Prefix所以它被视为货币符号。
The long and short of it is that "+" has the "Line breaking class" of
PR or "Prefix" so it''s treated a bit like a currency symbol.



是的。但PR的含义在UAX#14中含糊不清,而散文

部分与正式部分相矛盾。

Yes. But the meaning of PR is described vaguely in UAX #14, and the prose
part contradicts the formal parts.


现在,我认为这意味着默认情况下你不能打破C +或者

" + C",基于PR的定义。


不确定它们的意思是默认情况下。我还没看完整个

规格。
Now, I think that means that "by default" you can''t break "C+" or
"+C", based on the definition of PR.

Not sure what they mean by "by default". I haven''t read the whole
spec.



我已经阅读了整个规范,我不确定它们的意思是默认情况下。

I have read the whole spec, and I''m not sure what they mean "by default".


但是如果你看看7.3节中的配对表,那就说你可以在C +之间打破
。 (和++)但不在+ C之间,这正是Opera所做的b
。 (C类是AL - 字母或
)。 在C +之间断开是指在C和C之间断开。并且

为+。
But if you look at the pair table in section 7.3, that says you can
break between "C+" (and "++") but not between "+C", which is just what
Opera is doing. (The class of "C" is "AL"-- "alphabetic" or
something). By ''break between "C+"'' I mean break between the "C" and
the "+".



配对表前的正式规则意味着直接中断。 AL和PR之间以及PR和PR之间允许
,所以在C ++中,允许在任何地方(C和+之间)休息

以及+和+之间,以及

Opera以这种方式工作。 直接中断意味着即使没有空间干预也允许休息。


实际上,在我看来,配对表以及正式规则,

也允许PR和AL之间的直接中断。但它们可以防止PR

和NU(=数字)之间的中断,所以+1是牢不可破的,而+ A是可以破解的。

Opera 9.5不会破坏+ A,但是谁知道下一个版本是否会跟随UAX#14更加疯狂?

The formal rules before the pair table imply that a "direct break" is
allowed between AL and PR as well as between PR and PR, so in "C++", a break
is permitted anywhere (between C and + as well as between + and +), and
Opera works that way. "Direct break" means that a break is allowed even if
no space intervenes.

Actually, it seems to me that the pair table, as well as the formal rules,
also permits direct break between PR and AL. They prevent a break between PR
and NU (= number), though, so +1 is unbreakable whereas +A is breakable.
Opera 9.5 does not break +A, but who knows whether some next version will
follow UAX #14 to more madness?


如果你想阻止包装,毕竟C ++是使用+的特殊

,使用white-space:nowrap。
If you want to prevent wrapping, because after all C++ is a special
use of "+", use white-space: nowrap.



这是一种可能性并且大部分时间都有效,但你真的想要

让这些东西依赖于_styling_?我不认为这是一个问题

可选的表现特征是否你说的是C ++。或C + +或C + +。或者

C ++。


原因解释为
http://www.cs.tut.fi/~jkorpela/html/nobr.html

我认为最好使用< nobr> C ++< / nobr>。当标准错误时,

不要让他们阻止你以最好的方式做事。


-

Yucca, http://www.cs.tut.fi/~jkorpela/

That''s one possibility and works most of the time, but do you really want to
let such things depend on _styling_? I don''t think it is a matter of
optional presentational features whether you speak of "C++" or of "C+ +" or
"C ++".

For reasons explained at
http://www.cs.tut.fi/~jkorpela/html/nobr.html
I think it is preferable to use <nobr>C++</nobr>. When standards are wrong,
don''t let them prevent you from doing things the best possible way.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


这篇关于包装或不包装“C ++”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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