I understand that there are three flavours of line endings:
- LF
- CR
- CRLF
When I open my file with NotePad++ the line endings are CRLF:
But, when using the Scintilla control they are CR:
This is my code for reading the file:
void CScintillaHelper::ReadFile(const CString& filePath)
{
std::ifstream file(filePath);
if (file.is_open())
{
m_edit.ClearAll();
std::string line;
while (std::getline(file, line))
{
m_edit.AppendText(line.size(), line.c_str());
m_edit.AppendText(1, L"\r\n");
}
file.close();
m_edit.SetSavePoint();
}
}
Why is this? Not a big issue.