Fix of 3838.
svn: r15232
This commit is contained in:
parent
c0fa9b4b37
commit
441c7fb720
11
src/Utils.py
11
src/Utils.py
@ -331,10 +331,11 @@ def get_unicode_path(path):
|
|||||||
:rtype: unicode
|
:rtype: unicode
|
||||||
:returns: The Unicode version of path.
|
:returns: The Unicode version of path.
|
||||||
"""
|
"""
|
||||||
if constfunc.win():
|
# Don't make unicode of unicode as this does not work
|
||||||
return unicode(path)
|
# with parameter for encoding.
|
||||||
else:
|
if type(path) == type(u""):
|
||||||
return unicode(path,sys.getfilesystemencoding())
|
return path
|
||||||
|
return unicode(path,sys.getfilesystemencoding())
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -1353,7 +1354,7 @@ def navigation_label(db, nav_type, handle):
|
|||||||
label = " ".join(label.split())
|
label = " ".join(label.split())
|
||||||
# When strings are cut, make sure they are unicode
|
# When strings are cut, make sure they are unicode
|
||||||
#otherwise you may end of with cutting within an utf-8 sequence
|
#otherwise you may end of with cutting within an utf-8 sequence
|
||||||
label = unicode(label)
|
label = get_unicode_path(label)
|
||||||
if len(label) > 40:
|
if len(label) > 40:
|
||||||
label = label[:40] + "..."
|
label = label[:40] + "..."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user