Update ustr.py

This commit is contained in:
yangjiangjie 2019-01-04 12:02:26 +08:00 committed by darrenl
parent d27e6a5dfa
commit a0fa187eff

View File

@ -9,7 +9,9 @@ def ustr(x):
if type(x) == str: if type(x) == str:
return x.decode(DEFAULT_ENCODING) return x.decode(DEFAULT_ENCODING)
if type(x) == QString: if type(x) == QString:
return unicode(x) #https://blog.csdn.net/friendan/article/details/51088476
#https://blog.csdn.net/xxm524/article/details/74937308
return unicode(x.toUtf8(), DEFAULT_ENCODING, 'ignore')
return x return x
else: else:
return x return x