Comment 4 for bug 1406505

Revision history for this message
Laurent Bigonville (bigon) wrote :

Mhh, 'home/bigon/incapacit\xe9_0614.jpg' is coming from duplicity and is obviously latin1.

When modifying the unf() function from

def ufn(filename):
    "Convert a (bytes) filename to unicode for printing"
    assert not isinstance(filename, unicode)
    return filename.decode(sys.getfilesystemencoding(), 'replace')

to

def ufn(filename):
    "Convert a (bytes) filename to unicode for printing"
    assert not isinstance(filename, unicode)
    return filename.decode('latin1', 'replace')

The string is being encoded as: 'home/bigon/incapacit\xc3\xa9_0614.jpg', which is valid utf8