code: 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
docs: Same as 'toPlainText', replace '\n'
          by correct end-of-line characters