]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.448
- remove missing .po files
[packages/vim.git] / 6.2.448
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.448
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.2.448 (after 6.2.427)
11 Problem:    Mac: conversion done when 'termencoding' differs from 'encoding'
12             fails when pasting a longer text.
13 Solution:   Check for an incomplete sequence at the end of the chunk to be
14             converted. (Eckehard Berns)
15 Files:      src/mbyte.c
16
17
18 *** ../vim-6.2.447/src/mbyte.c  Sun Apr  4 16:30:29 2004
19 --- src/mbyte.c Sun Apr  4 22:25:08 2004
20 ***************
21 *** 5284,5289 ****
22 --- 5417,5423 ----
23    * vcp->vc_type must have been initialized to CONV_NONE.
24    * Note: cannot be used for conversion from/to ucs-2 and ucs-4 (will use utf-8
25    * instead).
26 +  * Afterwards invoke with "from" and "to" equal to NULL to cleanup.
27    * Return FAIL when conversion is not supported, OK otherwise.
28    */
29       int
30 ***************
31 *** 5371,5376 ****
32 --- 5505,5512 ----
33       return OK;
34   }
35   
36 + #if defined(FEAT_GUI) || defined(AMIGA) || defined(WIN3264) \
37 +       || defined(MSDOS) || defined(PROTO)
38   /*
39    * Do conversion on typed input characters in-place.
40    * The input and output are not NUL terminated!
41 ***************
42 *** 5384,5389 ****
43 --- 5520,5526 ----
44   {
45       return convert_input_safe(ptr, len, maxlen, NULL, NULL);
46   }
47 + #endif
48   
49   /*
50    * Like convert_input(), but when there is an incomplete byte sequence at the
51 ***************
52 *** 5428,5452 ****
53   }
54   
55   #if defined(MACOS_X)
56 ! static char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, CFStringEncoding from, CFStringEncoding to));
57   
58   /*
59 !  * A Mac version of string_convert() for special cases.
60    */
61       static char_u *
62 ! mac_string_convert(ptr, len, lenp, fail_on_error, from, to)
63       char_u            *ptr;
64       int                       len;
65       int                       *lenp;
66       int                       fail_on_error;
67       CFStringEncoding  from;
68       CFStringEncoding  to;
69   {
70       char_u            *retval, *d;
71       CFStringRef               cfstr;
72       int                       buflen, in, out, l, i;
73   
74       cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
75       if (cfstr == NULL)
76         return NULL;
77       if (to == kCFStringEncodingUTF8)
78 --- 5565,5601 ----
79   }
80   
81   #if defined(MACOS_X)
82 ! static char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, CFStringEncoding from, CFStringEncoding to, int *unconvlenp));
83   
84   /*
85 !  * A Mac version of string_convert_ext() for special cases.
86    */
87       static char_u *
88 ! mac_string_convert(ptr, len, lenp, fail_on_error, from, to, unconvlenp)
89       char_u            *ptr;
90       int                       len;
91       int                       *lenp;
92       int                       fail_on_error;
93       CFStringEncoding  from;
94       CFStringEncoding  to;
95 +     int                       *unconvlenp;
96   {
97       char_u            *retval, *d;
98       CFStringRef               cfstr;
99       int                       buflen, in, out, l, i;
100   
101 +     if (unconvlenp != NULL)
102 +       *unconvlenp = 0;
103       cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
104 +     /* When conversion failed, try excluding bytes from the end, helps when
105 +      * there is an incomplete byte sequence.  Only do up to 6 bytes to avoid
106 +      * looping a long time when there really is something unconvertable. */
107 +     while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
108 +     {
109 +       --len;
110 +       ++*unconvlenp;
111 +       cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
112 +     }
113       if (cfstr == NULL)
114         return NULL;
115       if (to == kCFStringEncodingUTF8)
116 ***************
117 *** 5626,5650 ****
118         case CONV_MAC_LATIN1:
119             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
120                                         kCFStringEncodingMacRoman,
121 !                                       kCFStringEncodingISOLatin1);
122             break;
123   
124         case CONV_LATIN1_MAC:
125             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
126                                         kCFStringEncodingISOLatin1,
127 !                                       kCFStringEncodingMacRoman);
128             break;
129   
130         case CONV_MAC_UTF8:
131             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
132                                         kCFStringEncodingMacRoman,
133 !                                       kCFStringEncodingUTF8);
134             break;
135   
136         case CONV_UTF8_MAC:
137             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
138                                         kCFStringEncodingUTF8,
139 !                                       kCFStringEncodingMacRoman);
140             break;
141   # endif
142   
143 --- 5775,5803 ----
144         case CONV_MAC_LATIN1:
145             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
146                                         kCFStringEncodingMacRoman,
147 !                                       kCFStringEncodingISOLatin1,
148 !                                       unconvlenp);
149             break;
150   
151         case CONV_LATIN1_MAC:
152             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
153                                         kCFStringEncodingISOLatin1,
154 !                                       kCFStringEncodingMacRoman,
155 !                                       unconvlenp);
156             break;
157   
158         case CONV_MAC_UTF8:
159             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
160                                         kCFStringEncodingMacRoman,
161 !                                       kCFStringEncodingUTF8,
162 !                                       unconvlenp);
163             break;
164   
165         case CONV_UTF8_MAC:
166             retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
167                                         kCFStringEncodingUTF8,
168 !                                       kCFStringEncodingMacRoman,
169 !                                       unconvlenp);
170             break;
171   # endif
172   
173 *** ../vim-6.2.447/src/version.c        Sun Apr  4 16:35:39 2004
174 --- src/version.c       Mon Apr  5 19:39:04 2004
175 ***************
176 *** 639,640 ****
177 --- 639,642 ----
178   {   /* Add new patch number below this line */
179 + /**/
180 +     448,
181   /**/
182
183 -- 
184 In his lifetime van Gogh painted 486 oil paintings. Oddly enough, 8975
185 of them are to be found in the United States.
186
187  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
188 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
189 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
190  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
191
192 -- 
193 Error:015 - Unable to exit Windows.  Try the door.
194
195  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
196 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
197 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
198  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
This page took 0.036325 seconds and 3 git commands to generate.