summaryrefslogtreecommitdiff
path: root/apps/win_main.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-04-02 17:15:02 +0200
committerRobin Watts <robin.watts@artifex.com>2013-04-11 13:58:59 +0100
commit05f9887c211fff4195b5959bc71d2ef4b773fdc2 (patch)
tree0d402134362124bf26c40c5b6c4dc7b8dcd65780 /apps/win_main.c
parentb302892a8c302aee9ca6d2abab2f32afbee3a8a5 (diff)
downloadmupdf-05f9887c211fff4195b5959bc71d2ef4b773fdc2.tar.xz
win32: use unicode functions for password dialog.
Diffstat (limited to 'apps/win_main.c')
-rw-r--r--apps/win_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/win_main.c b/apps/win_main.c
index 70021399..47f74512 100644
--- a/apps/win_main.c
+++ b/apps/win_main.c
@@ -254,6 +254,7 @@ void winreplacefile(char *source, char *target)
static char pd_filename[256] = "The file is encrypted.";
static char pd_password[256] = "";
+static wchar_t pd_passwordw[256] = {0};
static char td_textinput[1024] = "";
static int td_retry = 0;
static int cd_nopts;
@@ -275,8 +276,9 @@ dlogpassproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
case 1:
pd_okay = 1;
- GetDlgItemTextA(hwnd, 3, pd_password, sizeof pd_password);
+ GetDlgItemTextW(hwnd, 3, pd_passwordw, nelem(pd_passwordw));
EndDialog(hwnd, 1);
+ WideCharToMultiByte(CP_UTF8, 0, pd_passwordw, -1, pd_password, sizeof pd_password, NULL, NULL);
return TRUE;
case 2:
pd_okay = 0;