| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * | 3 * |
| 4 * Copyright (C) 1998-2007, International Business Machines | 4 * Copyright (C) 1998-2007, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ****************************************************************************** | 7 ****************************************************************************** |
| 8 * | 8 * |
| 9 * ucnv.c: | 9 * ucnv.c: |
| 10 * Implements APIs for the ICU's codeset conversion library; | 10 * Implements APIs for the ICU's codeset conversion library; |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 /* copy toUBytes[] to invalidCharBuffer[] */ | 1521 /* copy toUBytes[] to invalidCharBuffer[] */ |
| 1522 errorInputLength=cnv->invalidCharLength=cnv->toULength; | 1522 errorInputLength=cnv->invalidCharLength=cnv->toULength; |
| 1523 if(errorInputLength>0) { | 1523 if(errorInputLength>0) { |
| 1524 uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLen
gth); | 1524 uprv_memcpy(cnv->invalidCharBuffer, cnv->toUBytes, errorInputLen
gth); |
| 1525 } | 1525 } |
| 1526 | 1526 |
| 1527 /* set the converter state to deal with the next character */ | 1527 /* set the converter state to deal with the next character */ |
| 1528 cnv->toULength=0; | 1528 cnv->toULength=0; |
| 1529 | 1529 |
| 1530 /* call the callback function */ | 1530 /* call the callback function */ |
| 1531 if(cnv->toUCallbackReason==UCNV_ILLEGAL && *err==U_INVALID_CHAR_FOUN
D) { |
| 1532 cnv->toUCallbackReason = UCNV_UNASSIGNED; |
| 1533 } |
| 1531 cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs, | 1534 cnv->fromCharErrorBehaviour(cnv->toUContext, pArgs, |
| 1532 cnv->invalidCharBuffer, errorInputLength, | 1535 cnv->invalidCharBuffer, errorInputLength, |
| 1533 (*err==U_INVALID_CHAR_FOUND || *err==U_UNSUPPORTED_ESCAPE_SEQUEN
CE) ? | 1536 cnv->toUCallbackReason, |
| 1534 UCNV_UNASSIGNED : UCNV_ILLEGAL, | |
| 1535 err); | 1537 err); |
| 1538 cnv->toUCallbackReason = UCNV_ILLEGAL; /* reset to default value */ |
| 1536 | 1539 |
| 1537 /* | 1540 /* |
| 1538 * loop back to the offset handling | 1541 * loop back to the offset handling |
| 1539 * | 1542 * |
| 1540 * this flag will indicate after offset handling | 1543 * this flag will indicate after offset handling |
| 1541 * that a callback was called; | 1544 * that a callback was called; |
| 1542 * if the callback did not resolve the error, then we return | 1545 * if the callback did not resolve the error, then we return |
| 1543 */ | 1546 */ |
| 1544 calledCallback=TRUE; | 1547 calledCallback=TRUE; |
| 1545 } | 1548 } |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2879 #endif | 2882 #endif |
| 2880 | 2883 |
| 2881 /* | 2884 /* |
| 2882 * Hey, Emacs, please set the following: | 2885 * Hey, Emacs, please set the following: |
| 2883 * | 2886 * |
| 2884 * Local Variables: | 2887 * Local Variables: |
| 2885 * indent-tabs-mode: nil | 2888 * indent-tabs-mode: nil |
| 2886 * End: | 2889 * End: |
| 2887 * | 2890 * |
| 2888 */ | 2891 */ |
| OLD | NEW |