Changeset 341 for branches/samba-3.2.x/source/lib/iconv.c
- Timestamp:
- Oct 8, 2009, 8:22:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/lib/iconv.c
r133 r341 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. SCS 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, … … 138 152 #ifdef __OS2__ 139 153 uint16 *outbuf_uc = ( uint16 * )*outbuf; 154 char *to_name = save_toname(NULL, 1); 140 155 #endif 141 156 size_t ret = iconv((iconv_t)cd, … … 151 166 else 152 167 { 153 while(( char * )outbuf_uc < *outbuf ) 154 { 155 if( *outbuf_uc == 0x20a9 || /* Korean WON */ 156 *outbuf_uc == 0x00a5 ) /* Japanese YEN */ 157 *outbuf_uc = '\\'; 158 159 outbuf_uc++; 160 } 168 if( (strstr(to_name, "949") != NULL) || /* Korean CP */ 169 (strstr(to_name, "932") != NULL) || /* Japanese CP */ 170 (strstr(to_name, "942") != NULL) || /* Japanese CP */ 171 (strstr(to_name, "943") != NULL) ) /* Japanese CP */ 172 { 173 while(( char * )outbuf_uc < *outbuf ) 174 { 175 if( *outbuf_uc == 0x20a9 || /* Korean WON */ 176 *outbuf_uc == 0x00a5 ) /* Japanese YEN */ 177 *outbuf_uc = '\\'; 178 179 outbuf_uc++; 180 } 181 } 161 182 } 162 183 #endif … … 179 200 size_t bufsize; 180 201 202 #ifdef __OS2__ 203 save_toname(cd->to_name, 0); 204 #endif 205 181 206 /* in many cases we can go direct */ 182 207 if (cd->direct) {
Note:
See TracChangeset
for help on using the changeset viewer.