489 @param newFormat format to convert to |
489 @param newFormat format to convert to |
490 @type str |
490 @type str |
491 @return converted text |
491 @return converted text |
492 @rtype str |
492 @rtype str |
493 """ |
493 """ |
494 if oldFormat and newFormat: |
494 if txt and oldFormat and newFormat and oldFormat != newFormat: |
495 # step 1: convert the text to a byte array using the old format |
495 # step 1: convert the text to a byte array using the old format |
496 byteArray = self.__text2bytearray(txt, oldFormat) |
496 byteArray = self.__text2bytearray(txt, oldFormat) |
497 |
497 |
498 # step 2: convert the byte array to text using the new format |
498 # step 2: convert the byte array to text using the new format |
499 txt = self.__bytearray2text(byteArray, newFormat) |
499 txt = self.__bytearray2text(byteArray, newFormat) |