Archive for the 'bidi' Category

Following Directions

Tuesday, December 5th, 2006

James Holderness just posted a helpful post discussing some of the issues with supporting bidirectional text in RSS. In the post he describes the functionality they implemented for Snarfer that attempts to guess the base directionality of text using a simple, but error prone, algorithm:

   1.  Initialise a counter to zero.
   2. Look at the first n characters of the content with markup stripped.
   3. If a character is from an RTL script, 4 increment the counter by one.
   4. If a character is from an LTR script, 5 decrement the counter by one.
   5. Once n characters have been processed, if the counter is positive, the content is considered to be RTL.

The key challenge with this approach is that it’s based on the premise that basically left-to-right text will contain more left-to-right characters than right-to-left characters. Obviously that’s not an assumption that’ll work out every time (which James duly acknowledges).

Unfortunately, with RSS, there is absolutely no reliable way of detecting the directionality of text that works 100% of the time short of explicitly sprinkling the Unicode Control Characters throughout the document; unfortunately most editors aren’t set up to support easy use of the Unicode Control Characters. The alternative is to try to guess the direction based on the specified language the way it appears IE7 does. However, even that approach is flawed as language is not always a clear indication of direction.

Personally, I think guessing sucks if you have the option of making it explicit. With Atom we have that opportunity.

Updated Atom Bidi Draft

Monday, November 20th, 2006

I sent off an update to the Atom bidi draft. Keep in mind that this has no official status whatsoever at this point so please don’t go off and write any production code that uses this. The update defines the ‘dir’ attribute within the Atom namespace, e.g.:

<feed xmlns="http://www.w3.org/2005/Atom" dir="rtl">
   ...
</feed>

Experimental support for this is already checked into Abdera’s extensions module if you want to play around with it.

Adding bidi support to Atom

Wednesday, October 4th, 2006

Following an initial suggestion by Rob Sayre to add a dir attribute to Atom, I’ve put together a very rough draft proposal for adding improved Bidi support to Atom. It could definitely use the critical eye of folks out there who produce bidi feeds. Please comment on the atom-syntax list. I’m also interested in hearing from feed reader implementors about whether making such a change to the core Atom spec would cause implementation / interop problems.


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser