4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Win32: When 'encoding' is "latin1" 'ignorecase' doesn't work for
12 characters with umlaut. (Joachim Hofmann)
13 Solution: Do not use islower()/isupper()/tolower()/toupper() but our own
14 functions. (Chris Lubinski)
15 Files: src/mbyte.c, src/regexp.c, src/vim.h
18 *** ../vim-7.1.060/src/mbyte.c Thu May 10 19:45:20 2007
19 --- src/mbyte.c Sat Aug 4 13:44:36 2007
22 /* Single byte: first check normally, then with ignore case. */
25 ! cdiff = TOLOWER_LOC(s1[i]) - TOLOWER_LOC(s2[i]);
30 /* Single byte: first check normally, then with ignore case. */
33 ! cdiff = MB_TOLOWER(s1[i]) - MB_TOLOWER(s2[i]);
37 *** ../vim-7.1.060/src/regexp.c Mon Aug 6 22:27:13 2007
38 --- src/regexp.c Sun Aug 5 15:43:27 2007
43 for (cu = 1; cu <= 255; cu++)
51 for (cu = 1; cu <= 255; cu++)
60 for (cu = 1; cu <= 255; cu++)
68 for (cu = 1; cu <= 255; cu++)
75 (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
76 || (c < 255 && prog->regstart < 255 &&
78 ! TOLOWER_LOC(prog->regstart) == TOLOWER_LOC(c)))))
79 retval = regtry(prog, col);
83 (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
84 || (c < 255 && prog->regstart < 255 &&
86 ! MB_TOLOWER(prog->regstart) == MB_TOLOWER(c)))))
87 retval = regtry(prog, col);
95 ! TOLOWER_LOC(*opnd) != TOLOWER_LOC(*reginput))))
97 else if (*opnd == NUL)
103 ! MB_TOLOWER(*opnd) != MB_TOLOWER(*reginput))))
105 else if (*opnd == NUL)
109 rst.nextb = *OPERAND(next);
112 ! if (isupper(rst.nextb))
113 ! rst.nextb_ic = TOLOWER_LOC(rst.nextb);
115 ! rst.nextb_ic = TOUPPER_LOC(rst.nextb);
118 rst.nextb_ic = rst.nextb;
120 rst.nextb = *OPERAND(next);
123 ! if (MB_ISUPPER(rst.nextb))
124 ! rst.nextb_ic = MB_TOLOWER(rst.nextb);
126 ! rst.nextb_ic = MB_TOUPPER(rst.nextb);
129 rst.nextb_ic = rst.nextb;
134 /* This doesn't do a multi-byte character, because a MULTIBYTECODE
135 ! * would have been used for it. */
138 ! cu = TOUPPER_LOC(*opnd);
139 ! cl = TOLOWER_LOC(*opnd);
140 while (count < maxcount && (*scan == cu || *scan == cl))
146 /* This doesn't do a multi-byte character, because a MULTIBYTECODE
147 ! * would have been used for it. It does handle single-byte
148 ! * characters, such as latin1. */
151 ! cu = MB_TOUPPER(*opnd);
152 ! cl = MB_TOLOWER(*opnd);
153 while (count < maxcount && (*scan == cu || *scan == cl))
162 ! cc = TOLOWER_LOC(c);
163 ! else if (islower(c))
164 ! cc = TOUPPER_LOC(c);
166 return vim_strchr(s, c);
173 ! cc = MB_TOLOWER(c);
174 ! else if (MB_ISLOWER(c))
175 ! cc = MB_TOUPPER(c);
177 return vim_strchr(s, c);
179 *** ../vim-7.1.060/src/vim.h Sat May 12 15:08:22 2007
180 --- src/vim.h Sat Aug 4 13:57:36 2007
186 ! # define MB_STRICMP(d, s) (has_mbyte ? mb_strnicmp((char_u *)(d), (char_u *)(s), (int)MAXCOL) : STRICMP((d), (s)))
187 ! # define MB_STRNICMP(d, s, n) (has_mbyte ? mb_strnicmp((char_u *)(d), (char_u *)(s), (int)(n)) : STRNICMP((d), (s), (n)))
189 # define MB_STRICMP(d, s) STRICMP((d), (s))
190 # define MB_STRNICMP(d, s, n) STRNICMP((d), (s), (n))
195 ! /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
196 ! * encoding because mb_stricmp() takes care of all ascii and non-ascii
197 ! * encodings, including characters with umluats in latin1, etc., while
198 ! * STRICMP() only handles the system locale version, which often does not
199 ! * handle non-ascii properly. */
201 ! # define MB_STRICMP(d, s) mb_strnicmp((char_u *)(d), (char_u *)(s), (int)MAXCOL)
202 ! # define MB_STRNICMP(d, s, n) mb_strnicmp((char_u *)(d), (char_u *)(s), (int)(n))
204 # define MB_STRICMP(d, s) STRICMP((d), (s))
205 # define MB_STRNICMP(d, s, n) STRNICMP((d), (s), (n))
206 *** ../vim-7.1.060/src/version.c Sat Aug 11 13:37:36 2007
207 --- src/version.c Sat Aug 11 13:55:24 2007
211 { /* Add new patch number below this line */
217 Support your right to bare arms! Wear short sleeves!
219 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
220 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
221 \\\ download, build and distribute -- http://www.A-A-P.org ///
222 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///