Skip to content

Commit

Permalink
windowTitle is not a TCHAR *, it is a UTF8 encoded char *
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-cellier-aka-nice committed Dec 28, 2018
1 parent 8d44470 commit 0eeffa0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion platforms/win32/vm/sqWin32.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ extern char imageName[]; /* full path and name to image */
extern TCHAR imagePath[]; /* full path to image */
extern TCHAR vmPath[]; /* full path to interpreter's directory */
extern TCHAR vmName[]; /* name of the interpreter's executable */
extern TCHAR windowTitle[]; /* window title string */
extern char windowTitle[]; /* window title string */
extern char vmBuildString[]; /* the vm build string */
extern TCHAR windowClassName[]; /* class name for the window */

Expand Down
9 changes: 9 additions & 0 deletions platforms/win32/vm/sqWin32Prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,17 @@ void LoadPreferences()
}

/* get window title from ini file */
#ifdef UNICODE
{
TCHAR windowTitleT[MAX_PATH];
GetPrivateProfileString(U_GLOBAL, TEXT("WindowTitle"),
TEXT(""), windowTitleT, MAX_PATH, squeakIniName);
WideCharToMultiByte(CP_UTF8, 0, windowTitleT, -1, windowTitle, MAX_PATH, NULL, NULL);
}
#else
GetPrivateProfileString(U_GLOBAL, TEXT("WindowTitle"),
TEXT(""), windowTitle, MAX_PATH, squeakIniName);
#endif

/* get the window class name from the ini file */
GetPrivateProfileString(U_GLOBAL, TEXT("WindowClassName"),
Expand Down
2 changes: 1 addition & 1 deletion platforms/win32/vm/sqWin32Window.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ char imageName[MAX_PATH+1]; /* full path and name to image */
TCHAR imagePath[MAX_PATH+1]; /* full path to image */
TCHAR vmPath[MAX_PATH+1]; /* full path to interpreter's directory */
TCHAR vmName[MAX_PATH+1]; /* name of the interpreter's executable */
TCHAR windowTitle[MAX_PATH]; /* what should we display in the title? */
char windowTitle[MAX_PATH]; /* what should we display in the title? */
TCHAR squeakIniName[MAX_PATH+1]; /* full path and name to ini file */
TCHAR windowClassName[MAX_PATH+1]; /* Window class name */

Expand Down

0 comments on commit 0eeffa0

Please sign in to comment.