Fix of 3838.

svn: r15232
This commit is contained in:
Peter Landgren 2010-04-19 13:11:27 +00:00
parent c0fa9b4b37
commit 441c7fb720

View File

@ -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] + "..."