if it is alreayd unicode instance, do not decode

This commit is contained in:
Nikos Kouremenos 2006-11-02 13:40:57 +00:00
parent 18207be244
commit c494b7f5b9
1 changed files with 2 additions and 0 deletions

View File

@ -550,6 +550,8 @@ def get_icon_name_to_show(contact, account = None):
def decode_string(string): def decode_string(string):
'''try to decode (to make it Unicode instance) given string''' '''try to decode (to make it Unicode instance) given string'''
if isinstance(string, unicode):
return string
# by the time we go to iso15 it better be the one else we show bad characters # by the time we go to iso15 it better be the one else we show bad characters
encodings = (sys.getfilesystemencoding(), 'utf-8', 'iso-8859-15') encodings = (sys.getfilesystemencoding(), 'utf-8', 'iso-8859-15')
for encoding in encodings: for encoding in encodings: