I would surmise that the non-ASCII character requires more than a single byte to represent. For example, to represent a 'n' character in UTF-8 would be 0x6E. But to represent 'ñ' would be two bytes, 0xC3 and 0xB1. Thus, adding one of those characters might very well be throwing off your styling calculations.
This is a fundamental flaw (IMO) of the current ScintillaNET implementation. It doesn't account for Unicode characters. That's why I've started work on a rewrite which you can get an early preview of here: https://github.com/jacobslusser/ScintillaNET.
To get what you want working in the current version of ScintillaNET you'll have to do the arithmetic yourself to make sure you're counting the correct number of "bytes", not "characters" when you're styling.
Jacob
This is a fundamental flaw (IMO) of the current ScintillaNET implementation. It doesn't account for Unicode characters. That's why I've started work on a rewrite which you can get an early preview of here: https://github.com/jacobslusser/ScintillaNET.
To get what you want working in the current version of ScintillaNET you'll have to do the arithmetic yourself to make sure you're counting the correct number of "bytes", not "characters" when you're styling.
Jacob