Re: how to make format operator % work with unicode as expected

2008-01-27 Thread John Machin
On Jan 27, 3:06 pm, Peter Pei [EMAIL PROTECTED] wrote: I probably should mention that what I want is to make all parts of the string aligned, and look like table. I am not looking for other ways to make it table-alike, but only interested in making % work with unicode -counting characters not

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Stefan Behnel
Ever heard the word PLONK? Peter Pei harshly top-posted: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Marc 'BlackJack' Rintsch
On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Colin J. Williams
Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of alignment. If you don't understand my

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Diez B. Roggisch
Peter Pei schrieb: I am using things like %-20s%-60s%-10s in tkinter listbox to make it look like a table, with mono sized font like lucie system. But this does not work with data contains Les misérables, because it is unicode, and one byte is not neccessary one character. Now how can I

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Peter Pei
I V [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Peter Pei
Steven D'Aprano [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Peter Pei
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the

Re: how to make format operator % work with unicode as expected

2008-01-27 Thread Marc 'BlackJack' Rintsch
On Sun, 27 Jan 2008 16:00:42 +, Peter Pei wrote: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support

how to make format operator % work with unicode as expected

2008-01-26 Thread Peter Pei
I am using things like %-20s%-60s%-10s in tkinter listbox to make it look like a table, with mono sized font like lucie system. But this does not work with data contains Les misérables, because it is unicode, and one byte is not neccessary one character. Now how can I resolve this issue? My

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Peter Pei
I probably should mention that what I want is to make all parts of the string aligned, and look like table. I am not looking for other ways to make it table-alike, but only interested in making % work with unicode -counting characters not bytes... --

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Steven D'Aprano
On Sun, 27 Jan 2008 04:06:45 +, Peter Pei wrote: I probably should mention that what I want is to make all parts of the string aligned, and look like table. I am not looking for other ways to make it table-alike, but only interested in making % work with unicode -counting characters not

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Peter Pei
You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of alignment. If you don't understand my assertion, please don't argue

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Peter Pei
I just sorted posts by from, and figured out that you are kind of PSF guy... However that does not make you qualified, I care whether you are capable not whether you have the time to spend for PSF. Adios! == Peter Pei [EMAIL PROTECTED] wrote in message

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Peter Pei
For sure I can calculate the number of characters and do the padding myself, but what's the point, and i surely hope that python does it for me. Peter Pei [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am using things like %-20s%-60s%-10s in tkinter listbox to make it

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread I V
On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of alignment. If you don't understand my assertion, please don't argue

Re: how to make format operator % work with unicode as expected

2008-01-26 Thread Steven D'Aprano
On Sun, 27 Jan 2008 05:32:40 +, Peter Pei wrote: You didn't understand my question, but thanks any way. Yes, it is true that %s already support unicode, and I did not contradict that. But it counts the number of bytes instead of characters, and makes things like %-20s out of alignment.