'Same as \'toPlainText\', replace \'
by correct end-of-line characters'

def get_text_with_eol(self):

    utext = to_text_string(self.toPlainText())
    lines = utext.splitlines()
    linesep = self.get_line_separator()
    txt = linesep.join(lines)
    if utext.endswith('\n'):
        txt += linesep
    return txt
