Styling in an STC editor

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.)