| 317 | || ((x) != NULL && (y) != NULL && !strcasecmp((x), (y)))) |
| 318 | |
| 319 | static bool decoder_update(rfc2047_entry* entry, |
| 320 | const char* fromCharset, const char* toCharset, |
| 321 | acl::mime_code* pDecoder, acl::charset_conv* pConv, |
| 322 | string* out, string* buf1, string* buf2) |
| 323 | { |
| 324 | buf1->clear(); |
| 325 | pDecoder->decode_update(entry->pData->c_str(), |
| 326 | (int) entry->pData->length(), buf1); |
| 327 | if (buf1->empty()) { |
| 328 | return true; |
| 329 | } |
| 330 | |
| 331 | // ���Դ�ַ�����Ŀ���ַ�����ͬ�����ַ���ת�� |
| 332 | |
| 333 | if (EQ(fromCharset, toCharset) || pConv == NULL) { |
| 334 | out->append(buf1->c_str(), buf1->length()); |
| 335 | return true; |
| 336 | } |
| 337 | |
| 338 | // �����ַ���ת�� |
| 339 | |
| 340 | buf2->clear(); |
| 341 | |
| 342 | if (!pConv->update_begin(fromCharset, toCharset)) { |
| 343 | out->append(buf1->c_str(), buf1->length()); |
| 344 | } else if (!pConv->update(buf1->c_str(), buf1->length(), buf2)) { |
| 345 | out->append(buf1->c_str(), buf1->length()); |
| 346 | } else if (buf2->length() > 0) { |
| 347 | out->append(buf2->c_str(), buf2->length()); |
| 348 | } |
| 349 | |
| 350 | return true; |
| 351 | } |
| 352 | |
| 353 | static bool decoder_finish(acl::mime_code* pDecoder, acl::charset_conv* pConv, |
| 354 | string* out, string* buf1, string* buf2) |
no test coverage detected
searching dependent graphs…