diff src/video/wincommon/SDL_syswm.c @ 1505:4d005dfbb7f5

Fixed bug #139 The text in SDL_WM_SetCaption() is in UTF-8 encoding.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 13 Mar 2006 01:33:58 +0000
parents deb22b9fe970
children 720f8bb49d7d
line wrap: on
line diff
--- a/src/video/wincommon/SDL_syswm.c	Mon Mar 13 01:20:05 2006 +0000
+++ b/src/video/wincommon/SDL_syswm.c	Mon Mar 13 01:33:58 2006 +0000
@@ -230,12 +230,13 @@
 {
 #ifdef _WIN32_WCE
 	/* WinCE uses the UNICODE version */
-	int nLen = SDL_strlen(title)+1;
-	LPWSTR lpszW = alloca(nLen*2);
-	MultiByteToWideChar(CP_ACP, 0, title, -1, lpszW, nLen);
+	LPWSTR lpszW = SDL_iconv_utf8_ucs2(title);
 	SetWindowText(SDL_Window, lpszW);
+	SDL_free(lpszW);
 #else
-	SetWindowText(SDL_Window, title);
+	char *lpsz = SDL_iconv_utf8_latin1(title);
+	SetWindowText(SDL_Window, lpsz);
+	SDL_free(lpsz);
 #endif
 }