Hello, can you show me library for python which can detect (or decode - not nessecary) encoding of the string. I found chardet but it's not that what i need. Thanks.
+2
A:
I guess this is another option.
A collection of helper functions to detect encodings of text files (like HTML, XHTML, XML, CSS, etc.) retrieved via HTTP, file or string.
muitocomplicado
2009-05-04 08:55:36
Thanks. I'll try this.
Ockonal
2009-05-04 09:00:26
How can i get encoding info of the string?encutils.getEncodingInfo(text=self.ui.TextFrom.toPlainText())Calls an error: AttributeError: find in _getTextType.
Ockonal
2009-05-04 09:05:39
+7
A:
You need to convert your QString
to a Python string before passing it to chardet
. Change this:
chardet.detect(self.ui.TextFrom.toPlainText())
to this:
chardet.detect(str(self.ui.TextFrom.toPlainText()))
RichieHindle
2009-05-04 10:18:47