Skip to content

Commit

Permalink
Change to use wstring for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Feb 24, 2024
1 parent 904fc43 commit bab84f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion native/common/jp_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ class Win32PlatformAdapter : public JPPlatformAdapter
virtual void loadLibrary(const char* path) override
{
JP_TRACE_IN("Win32PlatformAdapter::loadLibrary");
jvmLibrary = LoadLibrary(path);
wchar_t *wpath = Py_DecodeLocale(path, NULL);
if (wpath == NULL)
{
JP_RAISE(PyExc_SystemError, "Unable to get JVM path with locale.");
}
jvmLibrary = LoadLibraryW(wpath);
PyMem_RawFree(wpath);
if (jvmLibrary == NULL)
{
JP_RAISE_OS_ERROR_WINDOWS( GetLastError(), path);
Expand Down

0 comments on commit bab84f0

Please sign in to comment.