Given a bytestring/unicode path, return it as unicode.

def to_unicode(path, errors="replace"):
    """Given a bytestring/unicode path, return it as unicode."""
    if isinstance(path, UNICODE):
        return path
    return path.decode(sys.getfilesystemencoding(), errors)