Re: Unicode text Direction Detection



On Wed, 17 Aug 2005, Gaurav Jain wrote:

> Could you give me some tips on how to go about implementing a "naive"
> version of such an algorithm?  Suppose I have a unicode character,
> what's the simplest way to know if it is a LTR directional character
> or a RTL directional character?


Here it is, using what's available in Glib:

  - If it's U+200E, LTR.
  - If it's U+200F, LTR.
  - If it's NOT of general category G_UNICODE_*_LETTER, ignore it.
  - If it's in the range U+0590..U+08FF, RTL.
  - Otherwise, LTR.


--behdad
http://behdad.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]