423 @param txt Python string to be converted |
419 @param txt Python string to be converted |
424 @type str, bytes, bytearray, unicode |
420 @type str, bytes, bytearray, unicode |
425 @return converted QByteArray |
421 @return converted QByteArray |
426 @rtype QByteArray |
422 @rtype QByteArray |
427 """ |
423 """ |
428 if sys.version_info[0] == 2: |
424 if isinstance(txt, str): |
429 if isinstance(txt, unicode): # __IGNORE_WARNING__ |
425 txt = txt.encode("utf-8") |
430 txt = txt.encode("utf-8") |
|
431 else: |
|
432 if isinstance(txt, str): |
|
433 txt = txt.encode("utf-8") |
|
434 |
426 |
435 return QByteArray(txt) |
427 return QByteArray(txt) |
436 |
428 |
437 |
429 |
438 def dataString(size): |
430 def dataString(size): |