Fix of 3838.

svn: r15231
This commit is contained in:
Peter Landgren 2010-04-19 13:08:00 +00:00
parent dd585eeb14
commit 33f27e5a9d

View File

@ -331,9 +331,10 @@ 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 path
return unicode(path, sys.getfilesystemencoding()) 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] + "..."