Hi,
I also found that some functions in os_win32.c don't use Unicode APIs.
* fname_case()
I think this should be fixed. Currently the case of a filename is not
set properly.
* mch_get_user_name()
Fixed with fix-utf8-username.patch.
* mch_get_host_name()
Fixed with fix-utf8-hostname.patch.
Actually I don't know that Windows can use multibyte characters in hostname.
* mch_nodetype()
I'm not sure this should be fixed. This doesn't seem to cause an obvious
problem.
* mch_system_piped()
Fixed with fix-utf8-msgloop.patch.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2631,6 +2631,26 @@
char szUserName[256 + 1]; /* UNLEN is 256 */
DWORD cch = sizeof szUserName;
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR wszUserName[256 + 1]; /* UNLEN is 256 */
+ DWORD wcch = sizeof(wszUserName) / sizeof(WCHAR);
+
+ if (GetUserNameW(wszUserName, &wcch))
+ {
+ char_u *p = utf16_to_enc(wszUserName, NULL);
+
+ if (p != NULL)
+ {
+ vim_strncpy(s, p, len - 1);
+ vim_free(p);
+ return OK;
+ }
+ }
+ /* Retry with non-wide function (for Windows 98). */
+ }
+#endif
if (GetUserName(szUserName, &cch))
{
vim_strncpy(s, szUserName, len - 1);
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2671,6 +2671,26 @@
{
DWORD cch = len;
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR wszHostName[256 + 1];
+ DWORD wcch = sizeof(wszHostName) / sizeof(WCHAR);
+
+ if (GetComputerNameW(wszHostName, &wcch))
+ {
+ char_u *p = utf16_to_enc(wszHostName, NULL);
+
+ if (p != NULL)
+ {
+ vim_strncpy(s, p, len - 1);
+ vim_free(p);
+ return;
+ }
+ }
+ /* Retry with non-wide function (for Windows 98). */
+ }
+#endif
if (!GetComputerName(s, &cch))
vim_strncpy(s, "PC (Win32 Vim)", len - 1);
}
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4091,10 +4091,10 @@
{
MSG msg;
- if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
+ if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
- DispatchMessage(&msg);
+ pDispatchMessage(&msg);
}
/* write pipe information in the window */