19 Aug 2011 22:57
Re: Fwd: unicode symbols and whitespaces
Patrick Totzke <patricktotzke <at> googlemail.com>
2011-08-19 20:57:47 GMT
2011-08-19 20:57:47 GMT
Hi again.
attached is a minimal example to reproduce this:
It seems to happen only in combination with Culumn widgets.
There are two notable things with this example:
First, the length of the encoded string `problematic` is of course 3,
so the column will get displayed with fixed length 3, which is not what I want.
Secondly, if you comment out the .encode('utf-8') in line 4, the length of the string
becomes 1, and then urwid diverges before displaying anything.
/p
On Aug 17, Patrick Totzke wrote:
>`
>Hi!
>
>I'm currently seing strange behaviour with Text widgets in combination with
>utf-8 and unicode strings:
>For certain symbols, like 'ιΆ–', urwid craches when displaying them (stacktrace below).
>But if i encode this to utf08 before handing it to urwid.Text,
>Its length gets calculated falsely:
>>s=u'\u9896'.encode('utf-8')
>> len(s) = 3
>so I get two whitespaces after the symbol on my screen..
>Best,
>/p
>
>
>
>
>
> self.mainloop.run()
(Continue reading)
RSS Feed