Armel Asselin wrote:
i'm testing my app against some files with accents on windows using
wxStyledTextCtrl (a derivative of scintilla). I'm trying to use some
french files... with many "é" and other such things... but it crashes
almost every lexer when built from the VC++ project. (Scite/Scilexer as
well).
it seems that the characters are almost never cast (if ever) to
'unsigned char' before being sent to 'isalnum' or such... and VC++ libc
does not like negavtie characters at all.
should there be a setting for compiling with 'char as unsigned' ? (I
tried and it works... but should I have?)
the problem does not seem exhibit on the linux build of wxSTC.
(I build with VC++ 7.1.3088, Compiler CL 13.10.3077)
Well, yes... the character-accessing stuff in the styling machinery
should not have been defined as returning "char" - for this and other
reasons. ;)
I attempt to deal with this by using static_cast<unsigned char>() when
pulling chars from a buffer with SafeGetCharAt() or "styler[]"
accesses... once a char is out of the buffer and safely in an int, you
do not have to worry any longer - well, as long as your ints are at
least 32 bits. :)
As for the global compiling with chars as unsigned, I would be
concerned about any code written to expect the language's normal
[signed char] behavior... as these cases could be very hard to detect,
it would be safer (IMHO) to avoid doing this.
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest