Changeset 553:2fe04b61ed95 in documentViewer


Ignore:
Timestamp:
Sep 24, 2012, 2:24:22 PM (12 years ago)
Author:
casties
Branch:
default
Message:

make sure unicodify and utf8ify return str and unicode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SrvTxtUtils.py

    r546 r553  
    1212
    1313
    14 srvTxtUtilsVersion = "1.5"
     14srvTxtUtilsVersion = "1.5.1"
    1515
    1616def getInt(number, default=0):
     
    3838            return s.decode('latin-1')
    3939    else:
    40         return s
     40        return unicode(s)
    4141
    4242def utf8ify(s):
     
    4545    if not s:
    4646        return ""
    47     if isinstance(s, str):
    48         return s
     47    if isinstance(s, unicode):
     48        return s.encode('utf-8')
    4949    else:
    50         return s.encode('utf-8')
     50        return str(s)
    5151
    5252def getText(node, recursive=0):
Note: See TracChangeset for help on using the changeset viewer.