双向文本,浏览器表现不佳 [英] Bidirectional text, browsers behaving badly

查看:62
本文介绍了双向文本,浏览器表现不佳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在许多语言的书名概述中,我在另一个帖子中写了一些关于某些标题的问题

这是从右到左书写的,如阿拉伯语和希伯来语。


有问题的页面是utf-8。理想情况下,Unicode BiDi

算法应该处理任何从右到左的文本。它好b / b
效果很好,除非标题以数字或标点符号开头,

没有固有的方向性因此需要

它们出现的父元素的方向性。


根据
http://www.w3.org/International/arti...-markup/#where

插入一个从右到左的标记应该可以解决问题。或者,你

可以使用带有dir属性的额外标记。


我把一个小测试页放在
http://www.phys.uu.nl/~gdevries/test/比迪/ testbidi.html 。它显示了一个

表,其中包含三种语言的标题。对于每种语言,标题都是< ul>中列出的

。希伯来语标题以20,000开头。是导致问题的那一个




唯一适用于我测试的所有浏览器的解决方案(Opera

7.54,IE6,FF)是添加一个额外的< cite>在每个标题周围。

仅使用rtl标记在Opera中不起作用,在该标记之前用

零宽度空间解决了Opera中的问题,但是让IE感到不安。


有人能提出他们的意见吗?关于为什么Opera无法处理的任何想法

正确的rtl标记?

[1] BTW,土耳其的标题实际上并没有提到Vingt mille谎言

sous les mers",但是Deux ans de vacances;我将这些包括在内以使

明确表示可以用各种*脚本*编写一个*语言*,并且必须给出

指示方向性的明确指示

在标题级别,而不是一种语言的所有标题。


Garmt de Vries。

In an overview of book titles in many languages, which I wrote about in
another thread, I''ve run across a problem with some titles in scripts
that are written from right to left, like Arabic and Hebrew.

The page in question is served as utf-8. Ideally, the Unicode BiDi
algorithm should take care of any right-to-left pieces of text. It
works well, except where a title starts with a number or punctuation,
which don''t have an inherent directionality and therefore take the
directionality of the parent element they occur in.

According to
http://www.w3.org/International/arti...-markup/#where,
inserting a right-to-left mark should do the trick. Alternatively, you
could use extra markup with a dir attribute.

I put together a little test page at
http://www.phys.uu.nl/~gdevries/test/bidi/testbidi.html. It shows a
table with titles in three languages. For each language, the titles are
listed in a <ul>. The Hebrew title starting with "20,000" is the one
causing the problem [1].

The only solution that works in all the browsers I tested in (Opera
7.54, IE6, FF) is to add an extra <cite> around each of the titles.
Using only a rtl mark doesn''t work in Opera, preceding that mark by a
zero-width space solves the problem in Opera, but upsets IE.

Could anyone offer their comments? Any ideas on why Opera can''t handle
the rtl mark correctly?
[1] BTW, the Turkish titles don''t actually refer to "Vingt mille lieues
sous les mers", but to "Deux ans de vacances"; I included these to make
clear that one *language* can be written in various *scripts*, and that
indication of the directionality, when explicitly given, must be given
at the title level, not for all titles in one language together.

Garmt de Vries.

推荐答案

" Garmt de Vries" < GD ***** @ hotmail.com>在消息中写道

news:11 ********************** @ g49g2000cwa.googlegr oups.com ...
"Garmt de Vries" <gd*****@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
在我用其他主题编写的许多语言的书名的概述中,我遇到了一些问题,其中一些标题是从右到左书写的。 ,像阿拉伯语和希伯来语。
我把一个小测试页放在
http://www.phys.uu.nl/~gdevries/test/bidi/testbidi.html 。它显示了一个包含三种语言标题的表。对于每种语言,标题都列在< ul>中。希伯来语标题以20,000开头。是导致问题的那个[1]。
唯一适用于我测试的所有浏览器的解决方案(Opera
7.54,IE6,FF)
In an overview of book titles in many languages, which I wrote about in
another thread, I''ve run across a problem with some titles in scripts
that are written from right to left, like Arabic and Hebrew. I put together a little test page at
http://www.phys.uu.nl/~gdevries/test/bidi/testbidi.html. It shows a
table with titles in three languages. For each language, the titles are
listed in a <ul>. The Hebrew title starting with "20,000" is the one
causing the problem [1]. The only solution that works in all the browsers I tested in (Opera
7.54, IE6, FF)




解决方案#5工作正常Opera 8.02

粗略的Google表明Opera7的RTL支持较差,早期版本没有。

没有。



Solution #5 works fine in Opera 8.02
A cursory Google shows that Opera7 had poor RTL support and earlier versions
had none.


On 2005年8月16日,Garmt de Vries写道:
On 16 Aug 2005, Garmt de Vries wrote:
有问题的页面是utf-8。理想情况下,Unicode BiDi


我想知道你是怎么来拼写BiDi的。资本D。

您可以写Bidi或BIDI;但是BiDi是不合理的。

算法应该处理从右到左的文本。


算法本身是指某些Unicode控制字符。

常见的不相信双向算法确实没有b
控制你的角色。相反,

你需要在text / plain

中使用Unicode控制字符来表示某些结构。这些控件的HTML等价物

字符是带有DIR属性的标记。

根据
http://www.w3.org/International/arti...-markup/#where
插入一个从右到左的标记应该可以解决问题。或者,您可以使用带有dir属性的额外标记。


对。插入& lrm; &安培; RLM;更容易,但HTML标记是

更安全,更适合_markup_语言HTML。

我把一个小测试页放在
http://www.phys.uu.nl/~gdevries/test/ bidi / testbidi.html
" 20,000"


这意味着20.000 = 20.

如果你的意思是两万,那就写20& nbsp; 000

(ISO 31 ,ISO 1000)

有人能提出他们的意见吗?


仔细阅读
http://ppewww.ph.gla.ac.uk/~flavell/...direction.html

并仔细检查以下示例
http:// ppewww .ph.gla.ac.uk / ~flavell / ... ir-sample.html
http://www.unics.uni-hannover.de/nht...onal-text.html

关于为什么Opera无法正确处理rtl标记的任何想法?
The page in question is served as utf-8. Ideally, the Unicode BiDi
I wonder how you come to the spelling "BiDi" with capital "D".
You might write "Bidi" or "BIDI"; but "BiDi" isn''t justified.
algorithm should take care of any right-to-left pieces of text.
The algorithm itself refers to certain Unicode control characters.
It is a common misbelieve that the bidirectional algorithm does
everything without control characters for you. On the contrary,
you are required to use Unicode control characters in text/plain
for certain constructions. The HTML equivalent for these control
characters is markup with the DIR attribute.
According to
http://www.w3.org/International/arti...-markup/#where,
inserting a right-to-left mark should do the trick. Alternatively, you
could use extra markup with a dir attribute.
Right. Inserting &lrm; &rlm; is easier but HTML markup is
safer and more suitable for the _markup_ language HTML.
I put together a little test page at
http://www.phys.uu.nl/~gdevries/test/bidi/testbidi.html.
"20,000"
This means 20.000 = 20.
If you mean twenty thousand, then write 20&nbsp;000
(ISO 31, ISO 1000)
Could anyone offer their comments?
Carefully read
http://ppewww.ph.gla.ac.uk/~flavell/...direction.html
and closely inspect the examples at
http://ppewww.ph.gla.ac.uk/~flavell/...ir-sample.html
http://www.unics.uni-hannover.de/nht...onal-text.html
Any ideas on why Opera can''t handle the rtl mark correctly?




Opera(和其他浏览器)在双向显示屏中被打破。

基于Mozilla的浏览器和Internet Explorer 6效果最好。

Mozilla和IE 6的区别在于,Mozilla(照例)是正确的。



Opera (and other browsers) are broken in their bidi display.
Mozilla-based browsers and Internet Explorer 6 work best.
Where Mozilla and IE 6 differ, Mozilla is (as usual) right.




Andreas Prilop写道:

Andreas Prilop wrote:
我想知道你是怎么来拼写的BiDi资本D。


键盘滑动......

Inserting& lrm; &安培; RLM;更容易,但HTML标记更安全,更适合_markup_语言HTML。


这只是一个比较重的问题。在我的情况下,我保留所有标题(

78种语言,一些语言的数百种标题,在一个

数据库中。一个RTL标记很容易添加到那些几个需要它的标题

(即以数字开头的阿拉伯语或希伯来语标题)。但是添加

标记,例如< cite>(这在语义上是有意义的)会添加

几百个< cite>< / cite>到该页面,具体取决于用户想要显示的那些

语言。此外,我必须保持所有标题的方向性跟踪。当然,这是可行的,但是

是最明智的做法吗?
I wonder how you come to the spelling "BiDi" with capital "D".
Slip of the keyboard...
Inserting &lrm; &rlm; is easier but HTML markup is
safer and more suitable for the _markup_ language HTML.
It''s just a bit heavier kB-wise. In my case, I keep all the titles (in
78 languages, with hundreds of titles for some languages, in a
database. A RTL mark is easily added to those few titles that need it
(i.e. Arabic or Hebrew titles starting with a number). But adding
markup like <cite> (which would make sense semantically) would add
several hundreds of <cite></cite>s to the page, depending on which
language(s) the user wants to see displayed. Also, I would have to keep
track of directionality for all the titles. It''s doable, of course, but
is it the smartest thing to do?
" 20,000"
"20,000"



这意味着20.000 = 20.
如果你的意思是两万,那么写20& nbsp; 000
(ISO 31,ISO 1000)



This means 20.000 = 20.
If you mean twenty thousand, then write 20&nbsp;000
(ISO 31, ISO 1000)




我引用的标题就是它们在现实生活中的使用方式。所以如果< br $> b $ b book具有20,000的在封面上,我把20,000放在在我的清单中。


顺便说一句,你不会使用比'& nbsp;'/ b
歌剧(和其他)更小的空间吗?在他们的双向显示器中打破了。



I quote the titles exactly how they are used in real life. So if the
book has "20,000" on its cover, I put "20,000" in my list.

BTW, wouldn''t you use a space that''s a bit narrower than &nbsp;?
Opera (and other browsers) are broken in their bidi display.




很可惜......


我猜最安全的方式现在就是使用标记。即使它有点重,但它有更大的可能性给出预期的结果,至少在所有浏览器都满足比迪烟要求之前,它们都是b $ b。 />



It''s a pity...

I guess the safest way to go for now is to use markup. Even if it''s a
bit heavier, it has a larger probability to give the intended result,
at least until all browsers have caught up with bidi requirements.


这篇关于双向文本,浏览器表现不佳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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