[Python-ideas] Fwd: Add Unicode-aware str.reverse() function?

Chris Angelico rosuav at gmail.com
Sat Sep 8 16:27:08 EDT 2018


On Sun, Sep 9, 2018 at 6:08 AM, Jonathan Fine <jfine2358 at gmail.com> wrote:
> Chris Angelico wrote:
>
>> Generally, problems with RTL text are *display* problems, and are not
>> solved by reversing strings.
>
> I very much agree with this statement, with one exception. If you wish
> to display RTL text on a LTR display, then a suitable reversing of
> strings is probably part of the solution.

That assumes that there is such a thing as an "LTR display". I
disagree. :) There are "buggy displays" and there are "flawed
displays" and there are "simplistic and naive displays", any or all of
which could be limited in what they're able to render (and for the
record, there's nothing inherently wrong with a simplistic display);
but for those, Arabic text simply won't display correctly. RTL text is
just one such problem (other examples include the way that different
characters affect each other - an Arabic word is not the same as the
abuttal of its individual characters - and the correct wrapping of
text that uses joiners and spacers), and perfect Unicode display is
*hard*.

Improving a rendering engine or console so it's capable of correct RTL
display is outside the scope of Python code, generally.

ChrisA


More information about the Python-ideas mailing list