[kopete-bugs] [Bug 173195] Pipes plugin doesn't support Unicode

Christoph Burgmer chrislb at gmx.de
Sun Dec 14 07:00:53 CET 2008


http://bugs.kde.org/show_bug.cgi?id=173195





--- Comment #2 from Christoph Burgmer <chrislb gmx de>  2008-12-14 06:58:52 ---
Can somebody confirm that this bug is or is not simply solved by replacing
toLocal8Bit() with toUtf8()? Both return a QByteArray, but for me only toUtf8()
actually does not delete non-ASCII characters:

$ python
Python 2.5.2 (r252:60911, Nov 14 2008, 19:46:32)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtCore import QString
>>> a = QString(u"你好")
>>> a
PyQt4.QtCore.QString(u'\u4f60\u597d')
>>> a.toUtf8()
PyQt4.QtCore.QByteArray('\xe4\xbd\xa0\xe5\xa5\xbd')
>>> a.toLocal8Bit()
PyQt4.QtCore.QByteArray('')
>>> 

I don't really understand Qt's behaviour/documentation here. On [1] is states,
that the system's encoding is used for conversion to 8 bit. My system uses
utf8, and in the case of using 2-/4-byte encodings, I can't guess the semantics
of that method.

[1] http://doc.trolltech.com/4.4/qstring.html#toLocal8Bit


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the kopete-bugs mailing list