Styling in an STC editor

Torsten Bronger bronger at physik.rwth-aachen.de
Sun Dec 10 16:43:53 PST 2006


Hallöchen!

I do my own syntax highlighting in an wx.py.editor.EditWindow.  For
achieving this, I say in my source

...
        text = self.GetTextRange(start, end)
        print len(text), end-start

If the text contains some umlauts, this prints on the screen

        1111 1123

Consequently, the highlighting is broken.  An .encode("utf-8") after
the GetTextRange() solves the issue, however, I wonder why this is,
and whether utf-8 is always correct, independent of the locale.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                                    ICQ 264-296-646
                   (See http://ime.webhop.org for Jabber, MSN, etc.)





More information about the wxpython-users mailing list