]>
Commit | Line | Data |
---|---|---|
46c5dd4b AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.3.052 (extra) | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.3.052 (extra) | |
11 | Problem: Windows 98: typed keys that are not ASCII may not work properly. | |
12 | For example with a Russian input method. (Jiri Jezdinsky) | |
13 | Solution: Assume that the characters arrive in the current codepage instead | |
14 | of UCS-2. Perform conversion based on that. | |
15 | Files: src/gui_w48.c | |
16 | ||
17 | ||
18 | *** ../vim-6.3.051/src/gui_w48.c Sat Dec 4 17:23:22 2004 | |
19 | --- src/gui_w48.c Sun Dec 5 19:34:54 2004 | |
20 | *************** | |
21 | *** 488,514 **** | |
22 | WCHAR wstring[2]; | |
23 | char_u *ws = NULL;; | |
24 | ||
25 | ! /* "ch" is a UTF-16 character. Convert it to a string of bytes. When | |
26 | ! * "enc_codepage" is non-zero use the standard Win32 function, otherwise | |
27 | ! * use our own conversion function (e.g., for UTF-8). */ | |
28 | ! wstring[0] = ch; | |
29 | ! if (enc_codepage > 0) | |
30 | ! len = WideCharToMultiByte(enc_codepage, 0, wstring, 1, string, slen, | |
31 | ! 0, NULL); | |
32 | else | |
33 | { | |
34 | len = 1; | |
35 | ! ws = ucs2_to_enc(wstring, &len); | |
36 | ! if (ws == NULL) | |
37 | ! len = 0; | |
38 | else | |
39 | { | |
40 | ! if (len > slen) /* just in case */ | |
41 | ! len = slen; | |
42 | ! mch_memmove(string, ws, len); | |
43 | ! vim_free(ws); | |
44 | } | |
45 | } | |
46 | if (len == 0) | |
47 | #endif | |
48 | { | |
49 | --- 488,536 ---- | |
50 | WCHAR wstring[2]; | |
51 | char_u *ws = NULL;; | |
52 | ||
53 | ! if (os_version.dwPlatformId != VER_PLATFORM_WIN32_NT) | |
54 | ! { | |
55 | ! /* On Windows 95/98 we apparently get the character in the active | |
56 | ! * codepage, not in UCS-2. If conversion is needed convert it to | |
57 | ! * UCS-2 first. */ | |
58 | ! if ((int)GetACP() == enc_codepage) | |
59 | ! len = 0; /* no conversion required */ | |
60 | ! else | |
61 | ! { | |
62 | ! string[0] = ch; | |
63 | ! len = MultiByteToWideChar(GetACP(), 0, string, 1, wstring, 2); | |
64 | ! } | |
65 | ! } | |
66 | else | |
67 | { | |
68 | + wstring[0] = ch; | |
69 | len = 1; | |
70 | ! } | |
71 | ! | |
72 | ! if (len > 0) | |
73 | ! { | |
74 | ! /* "ch" is a UTF-16 character. Convert it to a string of bytes. When | |
75 | ! * "enc_codepage" is non-zero use the standard Win32 function, | |
76 | ! * otherwise use our own conversion function (e.g., for UTF-8). */ | |
77 | ! if (enc_codepage > 0) | |
78 | ! len = WideCharToMultiByte(enc_codepage, 0, wstring, len, | |
79 | ! string, slen, 0, NULL); | |
80 | else | |
81 | { | |
82 | ! len = 1; | |
83 | ! ws = ucs2_to_enc(wstring, &len); | |
84 | ! if (ws == NULL) | |
85 | ! len = 0; | |
86 | ! else | |
87 | ! { | |
88 | ! if (len > slen) /* just in case */ | |
89 | ! len = slen; | |
90 | ! mch_memmove(string, ws, len); | |
91 | ! vim_free(ws); | |
92 | ! } | |
93 | } | |
94 | } | |
95 | + | |
96 | if (len == 0) | |
97 | #endif | |
98 | { | |
99 | *** ../vim-6.3.051/src/version.c Thu Dec 16 12:48:12 2004 | |
100 | --- src/version.c Thu Dec 16 12:53:28 2004 | |
101 | *************** | |
102 | *** 643,644 **** | |
103 | --- 643,646 ---- | |
104 | { /* Add new patch number below this line */ | |
105 | + /**/ | |
106 | + 52, | |
107 | /**/ | |
108 | ||
109 | -- | |
110 | From "know your smileys": | |
111 | y:-) Bad toupee | |
112 | ||
113 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
114 | /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
115 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
116 | \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html /// |