mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8242283: Can't start JVM when java home path includes non-ASCII character
Reviewed-by: naoto, hseigel
This commit is contained in:
parent
4a09f31eff
commit
d34f732b99
5 changed files with 11 additions and 11 deletions
|
@ -136,7 +136,7 @@ ZFILE_Open(const char *fname, int flags) {
|
|||
NULL);
|
||||
} else {
|
||||
/* Get required buffer size to convert to Unicode */
|
||||
int wfname_len = MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
|
||||
int wfname_len = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
|
||||
fname, -1, NULL, 0);
|
||||
if (wfname_len == 0) {
|
||||
return (jlong)INVALID_HANDLE_VALUE;
|
||||
|
@ -144,7 +144,7 @@ ZFILE_Open(const char *fname, int flags) {
|
|||
if ((wfname = (WCHAR*)malloc(wfname_len * sizeof(WCHAR))) == NULL) {
|
||||
return (jlong)INVALID_HANDLE_VALUE;
|
||||
}
|
||||
if (MultiByteToWideChar(CP_THREAD_ACP, MB_ERR_INVALID_CHARS,
|
||||
if (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
|
||||
fname, -1, wfname, wfname_len) == 0) {
|
||||
free(wfname);
|
||||
return (jlong)INVALID_HANDLE_VALUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue