Skip to content

Commit c572e1a

Browse files
committed
Merge pull request monero-project#9908
9891fe8 epee: fix string_tools on Windows (0xFFFC0000)
2 parents bc33cdf + 9891fe8 commit c572e1a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

contrib/epee/src/string_tools.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,15 @@ namespace string_tools
153153

154154
void set_module_name_and_folder(const std::string& path_to_process_)
155155
{
156-
boost::filesystem::path path_to_process = path_to_process_;
156+
boost::filesystem::path path_to_process;
157157

158158
#ifdef _WIN32
159-
path_to_process = get_current_module_path();
160-
#endif
159+
// Convert to wide string to avoid codecvt errors with Unicode paths
160+
std::wstring wpath = epee::string_tools::utf8_to_utf16(get_current_module_path());
161+
path_to_process = boost::filesystem::path(wpath);
162+
#else
163+
path_to_process = boost::filesystem::path(path_to_process_);
164+
#endif
161165

162166
get_current_module_name() = path_to_process.filename().string();
163167
get_current_module_folder() = path_to_process.parent_path().string();

0 commit comments

Comments
 (0)