diff --git a/asio/include/asio/detail/impl/win_iocp_file_service.ipp b/asio/include/asio/detail/impl/win_iocp_file_service.ipp index a698a2eda8..72739f3412 100644 --- a/asio/include/asio/detail/impl/win_iocp_file_service.ipp +++ b/asio/include/asio/detail/impl/win_iocp_file_service.ipp @@ -95,7 +95,10 @@ asio::error_code win_iocp_file_service::open( flags |= FILE_FLAG_WRITE_THROUGH; impl.offset_ = 0; - HANDLE handle = ::CreateFileA(path, access, share, 0, disposition, flags, 0); + size_t len = std::strlen(path) + 1; + auto wpath = std::make_unique(len); + std::mbstowcs(wpath.get(), path, len); + HANDLE handle = ::CreateFileW(wpath.get(), access, share, 0, disposition, flags, 0); if (handle != INVALID_HANDLE_VALUE) { if (disposition == OPEN_ALWAYS)