[wxPython-users] Re: Styling in an STC editor
Josiah Carlson
jcarlson at uci.edu
Sun Dec 10 22:38:02 PST 2006
Torsten Bronger <bronger at physik.rwth-aachen.de> wrote:
> Josiah Carlson writes:
> > As per the documentation on scintilla.org, the StyledTextControl
> > uses utf-8 as an underlying data representation. So yes,
> > text.encode('utf-8') will generally produce correct results,
> > regardless of locale.
>
> Thank you. Odd anyway ...
Not really. It's a very efficient representation for a large portion of
source code.
> > You should, however, be careful of line endings. I can't remember
> > off the top of my head everything, but I seem to remember that
> > there was something quite annoying with the way line endings were
> > handled in the stc. Always 2 characters? Always 1 character? 2
> > characters on Windows, 1 on Linux? Do some investigation.
>
> I test everything on Linux as well as Windows right now, and as far
> as I can see, it's at theast the same of both platforms. I always
> read in the very same test file, though.
Check it out with mixed line endings (files with \r, \n, and \r\n line
endings). Then set the line ending mode with SetEOLMode(). See if it
changes anything. Then try ConvertEOLs(). The method names I've listed
may not be correct.
- Josiah
More information about the wxpython-users
mailing list