From 05f8569f9fbb42209a50f3613344dbc1dcba404f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 8 Jan 2015 18:19:35 +0000 Subject: [PATCH] don't rely on internal utf8 functions from libtorrent --- examples/client_test.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index dad09ac79..7434e8d93 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -716,11 +716,8 @@ std::vector list_dir(std::string path if (!path.empty() && path[path.size()-1] != '\\') path += "\\*"; else path += "*"; - std::wstring wpath; - libtorrent::utf8_wchar(path, wpath); - - WIN32_FIND_DATAW fd; - HANDLE handle = FindFirstFileW(wpath.c_str(), &fd); + WIN32_FIND_DATAA fd; + HANDLE handle = FindFirstFileA(path.c_str(), &fd); if (handle == INVALID_HANDLE_VALUE) { ec.assign(GetLastError(), boost::system::system_category()); @@ -729,12 +726,11 @@ std::vector list_dir(std::string path do { - std::string p; - libtorrent::wchar_utf8(fd.cFileName, p); + std::string p = fd.cFileName; if (filter_fun(p)) ret.push_back(p); - } while (FindNextFileW(handle, &fd)); + } while (FindNextFileA(handle, &fd)); FindClose(handle); #else