Skip to content

Commit

Permalink
Merge pull request #1174 from Thrameos/windows-locale
Browse files Browse the repository at this point in the history
Windows locale
  • Loading branch information
marscher committed Apr 28, 2024
2 parents cdb6be2 + 2c0420e commit 653ccff
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 653ccff

Please sign in to comment.