Changeset 454 for trunk/server/source3/lib/iconv.c
- Timestamp:
- Jun 4, 2010, 3:11:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/lib/iconv.c
r414 r454 128 128 } 129 129 130 #ifdef __OS2__ 131 // i could have done a static variable w/o this function. but i feel it's nicer this way. 132 // the purpose of this function is to save the to_name to get the korean and japanese code set working 133 char * save_toname(char *toname, bool what) 134 { 135 static char *to_name=NULL; 136 137 if ( what == 0 ) 138 to_name = SMB_STRDUP(toname); 139 140 return to_name; 141 } 142 #endif 143 130 144 #ifdef HAVE_NATIVE_ICONV 131 145 /* if there was an error then reset the internal state, … … 136 150 char **outbuf, size_t *outbytesleft) 137 151 { 152 #ifdef __OS2__ 153 uint16 *outbuf_uc = ( uint16 * )*outbuf; 154 char *to_name = save_toname(NULL, 1); 155 #endif 156 138 157 size_t ret = iconv((iconv_t)cd, 139 158 (void *)inbuf, inbytesleft, … … 144 163 errno = saved_errno; 145 164 } 165 #ifdef __OS2__ 166 /* Workaround for path separator on OS/2 */ 167 else 168 { 169 if( (strstr(to_name, "949") != NULL) || /* Korean CP */ 170 (strstr(to_name, "932") != NULL) || /* Japanese CP */ 171 (strstr(to_name, "942") != NULL) || /* Japanese CP */ 172 (strstr(to_name, "943") != NULL) ) /* Japanese CP */ 173 { 174 while(( char * )outbuf_uc < *outbuf ) 175 { 176 if( *outbuf_uc == 0x20a9 || /* Korean WON */ 177 *outbuf_uc == 0x00a5 ) /* Japanese YEN */ 178 *outbuf_uc = '\\'; 179 180 outbuf_uc++; 181 } 182 } 183 } 184 #endif 185 146 186 return ret; 147 187 } … … 161 201 char *bufp = cvtbuf; 162 202 size_t bufsize; 203 #ifdef __OS2__ 204 save_toname(cd->to_name, 0); 205 #endif 163 206 164 207 /* in many cases we can go direct */
Note:
See TracChangeset
for help on using the changeset viewer.