code: def set_eol_chars(self, text):
          
          if not is_text_string(text): # testing for QString (PyQt API#1)
              text = to_text_string(text)
          eol_chars = sourcecode.get_eol_chars(text)
          is_document_modified = eol_chars is not None and self.eol_chars is not None
          self.eol_chars = eol_chars
          if is_document_modified:
              self.document().setModified(True)
              if self.sig_eol_chars_changed is not None:
                  self.sig_eol_chars_changed.emit(eol_chars)
docs: Set widget end-of-line (EOL) characters from text (analyzes text)