You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.
Here's the sample. It has to be cloned as whole project because of encoded test files.
After starting program - select any menu option - this would load one of the test files.
The correct text is "Zażółć gęślą jaźń.". But you will get something else - corrupt text.
Select any menu option again - you should see correct text. With any encoding option.
Uncomment line 20 in Test.cs ("scintilla1.Document = Document.Empty;")
Run program and select any option
Now text should be displayed correctly for each test from the first time.
The text was updated successfully, but these errors were encountered:
Upon closer examination, calling scintilla.Document = Document.Empty isn't really a fix. A side product of that call (and another bug) is that it is resetting the encoding used internally by Scintilla from UTF8 to the default. That gives the appearance that it is working but it actually isn't.
So in addition to determining what the underlying issue is, I believe I also have a fix to do when changing the document to make sure the encoding does not change.
The issue was that Scintilla stores some properties (e.g. Encoding) with
the document. Changing to a new document caused those properties to be
reset. This fix is to carry those properties over to the new document. A
related issue was that the UndoCollection property would get reset and
cause the SCN_MODIFIED notification to return null for the modified
text. This would cause the byte-to-char layer to get out of sync. Since
the UndoCollection property is so dangerous I removed it altogether.
https://github.com/HTD/ScintillaNET/tree/master/Test
Here's the sample. It has to be cloned as whole project because of encoded test files.
After starting program - select any menu option - this would load one of the test files.
The correct text is "Zażółć gęślą jaźń.". But you will get something else - corrupt text.
Select any menu option again - you should see correct text. With any encoding option.
Uncomment line 20 in Test.cs ("scintilla1.Document = Document.Empty;")
Run program and select any option
Now text should be displayed correctly for each test from the first time.
The text was updated successfully, but these errors were encountered: