Fix a bug when zip files in a directory containing locale characters in path.
BUG=248115
TEST=manual testing on windows
Review URL: https://chromiumcodereview.appspot.com/16632007
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d9551eaa68a55f771798771f05ee8a9e88d73b3b
diff --git a/google/zip.cc b/google/zip.cc
index 881c0ca..9e2de0d 100644
--- a/google/zip.cc
+++ b/google/zip.cc
@@ -52,7 +52,7 @@
bool AddEntryToZip(zipFile zip_file, const base::FilePath& path,
const base::FilePath& root_path) {
std::string str_path =
- path.AsUTF8Unsafe().substr(root_path.value().length() + 1);
+ path.AsUTF8Unsafe().substr(root_path.AsUTF8Unsafe().length() + 1);
#if defined(OS_WIN)
ReplaceSubstringsAfterOffset(&str_path, 0u, "\\", "/");
#endif