summaryrefslogtreecommitdiffstats
path: root/src/gui_w32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-01-28 20:23:17 +0000
committerBram Moolenaar <Bram@vim.org>2009-01-28 20:23:17 +0000
commit3ca9a8a00d69cf943a09cc7b49e04e1b9a9cefe9 (patch)
tree502b00d059d9c8b3942cde3245e1d65a113fb029 /src/gui_w32.c
parent7b76b0a0e923a14fdce0e350fb936a7784209b82 (diff)
updated for version 7.2-093v7.2.093
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r--src/gui_w32.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index a36f9766af..164e8c614e 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1582,6 +1582,17 @@ gui_mch_init(void)
s_findrep_struct.lpstrReplaceWith[0] = NUL;
s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ s_findrep_struct_w.lStructSize = sizeof(s_findrep_struct_w);
+ s_findrep_struct_w.lpstrFindWhat =
+ (LPWSTR)alloc(MSWIN_FR_BUFSIZE * sizeof(WCHAR));
+ s_findrep_struct_w.lpstrFindWhat[0] = NUL;
+ s_findrep_struct_w.lpstrReplaceWith =
+ (LPWSTR)alloc(MSWIN_FR_BUFSIZE * sizeof(WCHAR));
+ s_findrep_struct_w.lpstrReplaceWith[0] = NUL;
+ s_findrep_struct_w.wFindWhatLen = MSWIN_FR_BUFSIZE;
+ s_findrep_struct_w.wReplaceWithLen = MSWIN_FR_BUFSIZE;
+# endif
#endif
theend:
@@ -2938,8 +2949,27 @@ dialog_callback(
/* If the edit box exists, copy the string. */
if (s_textfield != NULL)
- GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2,
+ {
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ /* If the OS is Windows NT, and 'encoding' differs from active
+ * codepage: use wide function and convert text. */
+ if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR *wp = (WCHAR *)alloc(IOSIZE * sizeof(WCHAR));
+ char_u *p;
+
+ GetDlgItemTextW(hwnd, DLG_NONBUTTON_CONTROL + 2, wp, IOSIZE);
+ p = utf16_to_enc(wp, NULL);
+ vim_strncpy(s_textfield, p, IOSIZE);
+ vim_free(p);
+ vim_free(wp);
+ }
+ else
+# endif
+ GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2,
s_textfield, IOSIZE);
+ }
/*
* Need to check for IDOK because if the user just hits Return to