Please keep this post in English, as I am forwarding it to a developer
who does not speak Hebrew. Thanks.

In order to determine if a string is RTL this (untested) PHP regex was
suggested: preg_match( "|[ا-يא-ת]|", substr($text, 0, 1))

1) Is grepping the first letter of a string for a Hebrew or Arabic
character considered good enough to determine if a string should be
treated as RTL for purposes of setting directionality in HTML output?
2) Does Python have a better way of doing this?

Here is the related bug:
https://bugs.launchpad.net/zim/+bug/303108

Thanks!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه‍-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il

לענות