Lines Matching refs:errorCode
1892 UErrorCode errorCode;
1899 errorCode=U_ZERO_ERROR;
1900 cnv=ucnv_openCCSID(ccsid, UCNV_IBM, &errorCode);
1901 if(U_FAILURE(errorCode)) {
1902 log_data_err("error: ucnv_openCCSID(%ld) failed (%s)\n", ccsid, u_errorName(errorCode));
1906 if(ccsid!=ucnv_getCCSID(cnv, &errorCode)) {
1907 log_err("error: ucnv_getCCSID(ucnv_openCCSID(%ld))=%ld\n", ccsid, ucnv_getCCSID(cnv, &errorCode));
1911 if(ccsid != 1392 && UCNV_IBM!=ucnv_getPlatform(cnv, &errorCode)) {
1912 log_err("error: ucnv_getPlatform(ucnv_openCCSID(%ld))=%ld!=UCNV_IBM\n", ccsid, ucnv_getPlatform(cnv, &errorCode));
2147 UErrorCode errorCode;
2164 errorCode=U_ZERO_ERROR;
2179 FALSE, flush, &errorCode);
2186 if(errorCode==U_BUFFER_OVERFLOW_ERROR) {
2188 errorCode=U_ZERO_ERROR;
2194 } else if(U_FAILURE(errorCode)) {
2206 if(!(errorCode==expectCode || (expectCode==U_ZERO_ERROR && errorCode==U_STRING_NOT_TERMINATED_WARNING))) {
2208 errorCode), u_errorName(expectCode));
2265 UErrorCode errorCode;
2267 errorCode=U_ZERO_ERROR;
2268 cnv1=ucnv_open("UTF-8", &errorCode);
2269 if(U_FAILURE(errorCode)) {
2270 log_err("unable to open a UTF-8 converter - %s\n", u_errorName(errorCode));
2274 cnv2=ucnv_open("Shift-JIS", &errorCode);
2275 if(U_FAILURE(errorCode)) {
2276 log_data_err("unable to open a Shift-JIS converter - %s\n", u_errorName(errorCode));
2298 errorCode=U_STRING_NOT_TERMINATED_WARNING;
2304 NULL, NULL, NULL, NULL, TRUE, TRUE, &errorCode);
2305 if( errorCode!=U_ZERO_ERROR ||
2311 u_errorName(errorCode), target-targetBuffer, sizeof(shiftJIS));
2315 errorCode=U_AMBIGUOUS_ALIAS_WARNING;
2320 NULL, NULL, NULL, NULL, TRUE, TRUE, &errorCode);
2321 if( errorCode!=U_STRING_NOT_TERMINATED_WARNING ||
2327 u_errorName(errorCode), target-targetBuffer, sizeof(shiftJIS));
2331 errorCode=U_MESSAGE_PARSE_ERROR;
2335 NULL, NULL, NULL, NULL, TRUE, TRUE, &errorCode);
2336 if(errorCode!=U_MESSAGE_PARSE_ERROR) {
2337 log_err("ucnv_convertEx(U_MESSAGE_PARSE_ERROR) sets %s\n", u_errorName(errorCode));
2341 errorCode=U_ZERO_ERROR;
2344 pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer, TRUE, TRUE, &errorCode);
2345 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2346 log_err("ucnv_convertEx(pivotLimit==pivotStart) sets %s\n", u_errorName(errorCode));
2350 errorCode=U_ZERO_ERROR;
2353 pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+1, TRUE, TRUE, &errorCode);
2354 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2355 log_err("ucnv_convertEx(*pivotSource==NULL) sets %s\n", u_errorName(errorCode));
2359 errorCode=U_ZERO_ERROR;
2363 pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+1, TRUE, TRUE, &errorCode);
2364 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2365 log_err("ucnv_convertEx(*source==NULL) sets %s\n", u_errorName(errorCode));
2369 errorCode=U_ZERO_ERROR;
2373 NULL, &pivotSource, &pivotTarget, pivotBuffer+1, TRUE, FALSE, &errorCode);
2374 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2375 log_err("ucnv_convertEx(pivotStart==NULL) sets %s\n", u_errorName(errorCode));
2454 UErrorCode errorCode;
2456 errorCode=U_ZERO_ERROR;
2458 ucnv_getUnicodeSet(cnv, set, UCNV_ROUNDTRIP_SET, &errorCode);
2472 NULL, FALSE, &errorCode);
2480 NULL, FALSE, &errorCode);
2483 if(U_FAILURE(errorCode)) {
2484 log_err("unable to get test character for %s - %s\n", converterName, u_errorName(errorCode));
2509 UErrorCode errorCode;
2513 errorCode=U_ZERO_ERROR;
2514 ucnv_setToUCallBack(utf8Cnv, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL, &errorCode);
2533 errorCode=U_ZERO_ERROR;
2539 &errorCode);
2541 if(errorCode!=U_TRUNCATED_CHAR_FOUND || pivotSource!=pivotBuffer) {
2542 log_err("unexpected error %s from %s badUTF8[%ld]\n", u_errorName(errorCode), converterName, (long)i);
2546 errorCode=U_ZERO_ERROR;
2548 ucnv_getInvalidChars(utf8Cnv, invalidChars, &invalidLength, &errorCode);
2564 UErrorCode errorCode;
2567 errorCode=U_ZERO_ERROR;
2568 ucnv_setToUCallBack(utf8Cnv, UCNV_TO_U_CALLBACK_SKIP, NULL, NULL, NULL, &errorCode);
2617 UErrorCode errorCode;
2624 errorCode=U_ZERO_ERROR;
2625 utf8Cnv=ucnv_open("UTF-8", &errorCode);
2626 if(U_FAILURE(errorCode)) {
2627 log_data_err("unable to open UTF-8 converter - %s\n", u_errorName(errorCode));
2632 errorCode=U_ZERO_ERROR;
2633 cnv=ucnv_open(converterNames[i], &errorCode);
2634 if(U_FAILURE(errorCode)) {
2635 log_data_err("unable to open %s converter - %s\n", converterNames[i], u_errorName(errorCode));
2660 UErrorCode errorCode;
2683 errorCode=U_ZERO_ERROR;
2684 utf8Cnv=ucnv_open("UTF-8", &errorCode);
2685 if(U_FAILURE(errorCode)) {
2686 log_data_err("unable to open UTF-8 converter - %s\n", u_errorName(errorCode));
2691 errorCode=U_ZERO_ERROR;
2692 cnv=ucnv_open(converterNames[i], &errorCode);
2694 errorCode);
2695 if(U_FAILURE(errorCode)) {
2697 converterNames[i], u_errorName(errorCode));
2721 TRUE, TRUE, &errorCode);
2722 if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || src!=bad_utf8+2 ||
2761 UErrorCode errorCode;
2765 errorCode=U_ZERO_ERROR;
2766 cnv=ucnv_open("Shift-JIS", &errorCode);
2767 if(U_FAILURE(errorCode)) {
2768 log_data_err("unable to open a Shift-JIS converter - %s\n", u_errorName(errorCode));
2784 errorCode=U_ZERO_ERROR;
2785 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF8, target, sizeof(shiftJIS), (const char *)utf8, sizeof(utf8), &errorCode);
2786 if( errorCode!=U_STRING_NOT_TERMINATED_WARNING ||
2791 u_errorName(errorCode), length, sizeof(shiftJIS));
2796 errorCode=U_STRING_NOT_TERMINATED_WARNING;
2797 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, -1, &errorCode);
2798 if( errorCode!=U_ZERO_ERROR ||
2803 u_errorName(errorCode), length, sizeof(shiftJIS));
2807 errorCode=U_STRING_NOT_TERMINATED_WARNING;
2808 length=ucnv_toAlgorithmic(UCNV_UTF8, cnv, target, sizeof(target), shiftJISNUL, 0, &errorCode);
2809 if( errorCode!=U_ZERO_ERROR ||
2813 u_errorName(errorCode), length);
2817 errorCode=U_ZERO_ERROR;
2818 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode);
2819 if( errorCode!=U_STRING_NOT_TERMINATED_WARNING ||
2823 u_errorName(errorCode), length);
2826 errorCode=U_ZERO_ERROR;
2827 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF32, target, 0, (const char *)utf32, 4, &errorCode);
2828 if( errorCode!=U_STRING_NOT_TERMINATED_WARNING ||
2832 u_errorName(errorCode), length);
2836 errorCode=U_MESSAGE_PARSE_ERROR;
2837 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, (const char *)utf16, 2, &errorCode);
2838 if(errorCode!=U_MESSAGE_PARSE_ERROR) {
2839 log_err("ucnv_fromAlgorithmic(U_MESSAGE_PARSE_ERROR) sets %s\n", u_errorName(errorCode));
2843 errorCode=U_ZERO_ERROR;
2844 length=ucnv_fromAlgorithmic(cnv, UCNV_UTF16, target, 0, NULL, 2, &errorCode);
2845 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2846 log_err("ucnv_fromAlgorithmic(source==NULL) sets %s\n", u_errorName(errorCode));
2850 errorCode=U_ZERO_ERROR;
2851 length=ucnv_fromAlgorithmic(cnv, (UConverterType)99, target, 0, (const char *)utf16, 2, &errorCode);
2852 if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
2853 log_err("ucnv_fromAlgorithmic(illegal alg. type) sets %s\n", u_errorName(errorCode));
3041 UErrorCode errorCode;
3049 errorCode=U_ZERO_ERROR;
3050 swapCnv=ucnv_open(swapped, &errorCode);
3051 cnv=ucnv_open(name, &errorCode);
3052 if(U_FAILURE(errorCode)) {
3053 log_data_err("TestEBCDICSwapLFNL error: unable to open %s or %s (%s)\n", name, swapped, u_errorName(errorCode));
3058 swappedName=ucnv_getName(swapCnv, &errorCode);
3059 if(U_FAILURE(errorCode)) {
3060 log_err("TestEBCDICSwapLFNL error: ucnv_getName(%s,swaplfnl) failed (%s)\n", name, u_errorName(errorCode));
3073 ucnv_fromUnicode(cnv, &pc, normal+LENGTHOF(normal), &pcu, text+LENGTHOF(text), NULL, TRUE, &errorCode);
3078 ucnv_fromUnicode(swapCnv, &pc, swapped+LENGTHOF(swapped), &pcu, text+LENGTHOF(text), NULL, TRUE, &errorCode);
3081 if(U_FAILURE(errorCode)) {
3082 log_err("TestEBCDICSwapLFNL error converting to %s - (%s)\n", name, u_errorName(errorCode));
3111 ucnv_toUnicode(cnv, &pu, uNormal+LENGTHOF(uNormal), (const char **)&pc, normal+normalLength, NULL, TRUE, &errorCode);
3116 ucnv_toUnicode(swapCnv, &pu, uSwapped+LENGTHOF(uSwapped), (const char **)&pc, normal+swappedLength, NULL, TRUE, &errorCode);
3119 if(U_FAILURE(errorCode)) {
3120 log_err("TestEBCDICSwapLFNL error converting from %s - (%s)\n", name, u_errorName(errorCode));
3502 UErrorCode errorCode;
3507 errorCode=U_ZERO_ERROR;
3508 cnv=ucnv_open("UTF-16", &errorCode);
3509 if(U_FAILURE(errorCode)) {
3510 log_data_err("ucnv_open(UTF-16) failed - %s\n", u_errorName(errorCode));
3513 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode);
3515 if(U_FAILURE(errorCode) ||
3517 NULL == ucnv_detectUnicodeSignature(buffer, length, NULL, &errorCode)
3522 errorCode=U_ZERO_ERROR;
3523 cnv=ucnv_open("UTF-32", &errorCode);
3524 if(U_FAILURE(errorCode)) {
3525 log_data_err("ucnv_open(UTF-32) failed - %s\n", u_errorName(errorCode));
3528 length=ucnv_fromUChars(cnv, buffer, (int32_t)sizeof(buffer), surrogate, 1, &errorCode);
3530 if(U_FAILURE(errorCode) ||
3532 NULL == ucnv_detectUnicodeSignature(buffer, length, NULL, &errorCode)
3538 errorCode=U_ZERO_ERROR;
3539 cnv=ucnv_open("ISO-8859-1", &errorCode);
3540 if(U_FAILURE(errorCode)) {
3541 log_data_err("ucnv_open(ISO-8859-1) failed - %s\n", u_errorName(errorCode));
3544 ucnv_setSubstString(cnv, sub, LENGTHOF(sub), &errorCode);
3545 if(U_FAILURE(errorCode)) {
3546 log_err("ucnv_setSubstString(ISO-8859-1, sub[5]) failed - %s\n", u_errorName(errorCode));
3549 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode);
3551 if(U_FAILURE(errorCode) || len8!=sizeof(subChars) || 0!=uprv_memcmp(buffer, subChars, len8)) {
3552 log_err("ucnv_getSubstChars(ucnv_setSubstString(ISO-8859-1, sub[5])) failed - %s\n", u_errorName(errorCode));
3558 errorCode=U_ZERO_ERROR;
3559 cnv=ucnv_open("HZ", &errorCode);
3560 if(U_FAILURE(errorCode)) {
3561 log_data_err("ucnv_open(HZ) failed - %s\n", u_errorName(errorCode));
3564 ucnv_setSubstString(cnv, sub, LENGTHOF(sub), &errorCode);
3565 if(U_FAILURE(errorCode)) {
3566 log_err("ucnv_setSubstString(HZ, sub[5]) failed - %s\n", u_errorName(errorCode));
3569 ucnv_getSubstChars(cnv, buffer, &len8, &errorCode);
3571 if(U_FAILURE(errorCode) || len8!=0) {
3572 log_err("ucnv_getSubstChars(ucnv_setSubstString(HZ, sub[5])) failed - %s\n", u_errorName(errorCode));
3588 UErrorCode errorCode;
3595 errorCode=U_ZERO_ERROR;
3596 cnv=ucnv_open("UTF-8", &errorCode);
3597 if(U_FAILURE(errorCode)) {
3598 log_err("ucnv_open() failed - %s\n", u_errorName(errorCode));
3602 errorCode=U_ZERO_ERROR;
3604 ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsPtr, ucharsBadPtr, NULL, TRUE, &errorCode);
3605 if(errorCode != U_ILLEGAL_ARGUMENT_ERROR) {
3606 log_err("ucnv_fromUnicode() failed to return U_ILLEGAL_ARGUMENT_ERROR for incomplete UChar * buffer - %s\n", u_errorName(errorCode));
3609 errorCode=U_ZERO_ERROR;
3611 ucnv_fromUnicode(cnv, &charsPtr, charsPtr, (const UChar **)&ucharsBadPtr, ucharsPtr, NULL, TRUE, &errorCode);
3612 if(errorCode
3613 log_err("ucnv_fromUnicode() failed to return U_ILLEGAL_ARGUMENT_ERROR for bad limit pointer - %s\n", u_errorName(errorCode));
3616 errorCode=U_ZERO_ERROR;
3618 ucnv_toUnicode(cnv, &ucharsPtr, ucharsBadPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &errorCode);
3619 if(errorCode != U_ILLEGAL_ARGUMENT_ERROR) {
3620 log_err("ucnv_toUnicode() failed to return U_ILLEGAL_ARGUMENT_ERROR for incomplete UChar * buffer - %s\n", u_errorName(errorCode));
3623 errorCode=U_ZERO_ERROR;
3625 ucnv_toUnicode(cnv, &ucharsBadPtr, ucharsPtr, (const char **)&charsPtr, charsPtr, NULL, TRUE, &errorCode);
3626 if(errorCode != U_ILLEGAL_ARGUMENT_ERROR) {
3627 log_err("ucnv_toUnicode() failed to return U_ILLEGAL_ARGUMENT_ERROR for bad limit pointer - %s\n", u_errorName(errorCode));
3650 UErrorCode errorCode = U_ZERO_ERROR;
3651 UConverter *cnv = ucnv_open(names[i], &errorCode);
3652 if(U_SUCCESS(errorCode)) {
3653 const char *name = ucnv_getName(cnv, &errorCode);
3654 if(U_FAILURE(errorCode) || 0 != strcmp(name, names[i+1])) {
3656 names[i], name, names[i+1], u_errorName(errorCode));
3693 UErrorCode errorCode = U_ZERO_ERROR;
3694 UConverter *cnv = ucnv_open(names[i], &errorCode);
3697 if (U_FAILURE(errorCode)) {
3698 log_err_status(errorCode, "Unable to open converter: %s got error code: %s\n", names[i], u_errorName(errorCode));
3701 length = ucnv_fromUChars(cnv, bytes, (int32_t)sizeof(bytes), a16, 1, &errorCode);
3703 if(U_FAILURE(errorCode) || length != exp[0] || 0 != memcmp(bytes, exp+1, length)) {
3705 names[i], u_errorName(errorCode));