This commit is contained in:
Ivan Bondarev 2021-08-13 15:28:19 +02:00
parent eb2f13d1d7
commit 5c0199afd3
2 changed files with 2 additions and 0 deletions

View file

@ -650,6 +650,8 @@ namespace ICSharpCode.TextEditor
if (autodetectEncoding) {
Encoding encoding = this.Encoding;
Document.TextContent = Util.FileReader.ReadFileContent(stream, ref encoding);
if (Document.TextContent.IndexOf('\r') == -1 && Document.TextContent.IndexOf('\n') != -1)
Document.TextContent = Document.TextContent.Replace("\n", "\r\n");
this.Encoding = encoding;
} else {
using (StreamReader reader = new StreamReader(fileName, this.Encoding)) {

Binary file not shown.