Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #84799
| Date | 2015-01-28 20:01 -0700 |
|---|---|
| From | Michael Torrie <torriem@gmail.com> |
| Subject | Re: unicode question |
| References | <1422483422.18222.BPMail_high_carrier@web163802.mail.gq1.yahoo.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18250.1422500483.18130.python-list@python.org> (permalink) |
On 01/28/2015 03:17 PM, Albert-Jan Roskam wrote: >> I do not know how complete the support is, but this is copied from 3.4.2, which uses tcl/tk 8.6. >>>> t = "الحركات" >>>> for c in t: print(c) # Prints rightmost char above first >> ا >> ل >> ح >> ر >> ك >> ا >> ت > > Wow, I never knew this was so clever. Is that with or without an RTL marker? I don't think this has anything to do with Python. Python is simply spitting out unicode characters as it sees them, starting at string position 0 and working to the end. The magic is done by whatever is displaying the utf-8 output from Python. If I copy this text to the clipboard, t = "hi there, الحركات!" and paste it in my terminal (say to Python's shell), which is not BIDI aware, I get the Arabic letters in reverse order. I tried to paste it here but no matter what I do thunderbird goes into BIDI mode and makes them appear right.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: unicode question Michael Torrie <torriem@gmail.com> - 2015-01-28 20:01 -0700
csiph-web