From a6550b0ec3dde1cfba5ee116a3dc6d0caa9f6a36 Mon Sep 17 00:00:00 2001 From: Amir Abbas Date: Wed, 7 Mar 2018 09:56:53 +0330 Subject: [PATCH] Fixed utf8 filenames issue in OneDrive --- Sources/OneDriveHelper.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/OneDriveHelper.swift b/Sources/OneDriveHelper.swift index 899db7d..b9e32b4 100644 --- a/Sources/OneDriveHelper.swift +++ b/Sources/OneDriveHelper.swift @@ -134,9 +134,9 @@ public final class OneDriveFileObject: FileObject { } static func relativePathOf(url: URL, baseURL: URL?, route: OneDriveFileProvider.Route) -> String { - let base = baseURL?.appendingPathComponent(route.drivePath) + let base = baseURL?.appendingPathComponent(route.drivePath).path ?? "" - let crudePath = url.absoluteString.replacingOccurrences(of: base?.absoluteString ?? "", with: "", options: .anchored) + let crudePath = url.path.replacingOccurrences(of: base, with: "", options: .anchored) .trimmingCharacters(in: CharacterSet(charactersIn: "/")) switch crudePath {