4 ms·
It's how the directionality (right to left or left to right) is decided that is complicated for mixed texts (and always nothing but a heuristic). I must admit
by necovek 6y ago
It's how the directionality (right to left or left to right) is decided that is complicated for mixed texts (and always nothing but a heuristic).
I must admit that I was surprised that the following snippet kept the LTR order in my terminal:
>> [(chr(ord('0')+i), chr(0x07c0+i)) for i in range(10)]
[('0', '߀'), ('1', '߁'), ('2', '߂'), ('3', '߃'), ('4', '߄'), ('5', '߅'), ('6', '߆'), ('7', '߇'), ('8', '߈'), ('9', '߉')]
>>> [(chr(0x07c0+i), chr(ord('0')+i)) for i in range(10)]
[('߀', '0'), ('߁', '1'), ('߂', '2'), ('߃', '3'), ('߄', '4'), ('߅', '5'), ('߆', '6'), ('߇', '7'), ('߈', '8'), ('߉', '9')]