Lines Matching refs:last_error

142     } last_error;
881 ec->last_error.result = econv_source_buffer_empty;
882 ec->last_error.error_tc = NULL;
883 ec->last_error.source_encoding = NULL;
884 ec->last_error.destination_encoding = NULL;
885 ec->last_error.error_bytes_start = NULL;
886 ec->last_error.error_bytes_len = 0;
887 ec->last_error.readagain_len = 0;
1275 memset(&ec->last_error, 0, sizeof(ec->last_error));
1371 ec->last_error.result = res;
1376 ec->last_error.error_tc = error_tc;
1377 ec->last_error.source_encoding = error_tc->transcoder->src_encoding;
1378 ec->last_error.destination_encoding = error_tc->transcoder->dst_encoding;
1379 ec->last_error.error_bytes_start = TRANSCODING_READBUF(error_tc);
1380 ec->last_error.error_bytes_len = error_tc->recognized_len;
1381 ec->last_error.readagain_len = error_tc->readagain_len;
1400 if (encoding_equal(ec->last_error.source_encoding, "UTF-32BE")) {
1401 utf = ec->last_error.error_bytes_start;
1402 utf_len = ec->last_error.error_bytes_len;
1405 utf = allocate_converted_string(ec->last_error.source_encoding, "UTF-32BE",
1406 ec->last_error.error_bytes_start, ec->last_error.error_bytes_len,
1411 if (utf != utfbuf && utf != ec->last_error.error_bytes_start)
2042 if (ec->last_error.result == econv_invalid_byte_sequence ||
2043 ec->last_error.result == econv_incomplete_input) {
2044 const char *err = (const char *)ec->last_error.error_bytes_start;
2045 size_t error_len = ec->last_error.error_bytes_len;
2048 size_t readagain_len = ec->last_error.readagain_len;
2052 if (ec->last_error.result == econv_incomplete_input) {
2055 ec->last_error.source_encoding);
2063 ec->last_error.source_encoding);
2068 ec->last_error.source_encoding);
2074 rb_ivar_set(exc, rb_intern("incomplete_input"), ec->last_error.result == econv_incomplete_input ? Qtrue : Qfalse);
2077 rb_ivar_set(exc, rb_intern("source_encoding_name"), rb_str_new2(ec->last_error.source_encoding));
2078 rb_ivar_set(exc, rb_intern("destination_encoding_name"), rb_str_new2(ec->last_error.destination_encoding));
2079 idx = rb_enc_find_index(ec->last_error.source_encoding);
2082 idx = rb_enc_find_index(ec->last_error.destination_encoding);
2087 if (ec->last_error.result == econv_undefined_conversion) {
2088 VALUE bytes = rb_str_new((const char *)ec->last_error.error_bytes_start,
2089 ec->last_error.error_bytes_len);
2092 if (strcmp(ec->last_error.source_encoding, "UTF-8") == 0) {
2096 start = (const char *)ec->last_error.error_bytes_start;
2097 end = start + ec->last_error.error_bytes_len;
2100 (size_t)MBCLEN_CHARFOUND_LEN(n) == ec->last_error.error_bytes_len) {
2107 if (strcmp(ec->last_error.source_encoding,
2109 strcmp(ec->last_error.destination_encoding,
2113 ec->last_error.source_encoding,
2114 ec->last_error.destination_encoding);
2120 ec->last_error.destination_encoding,
2130 idx = rb_enc_find_index(ec->last_error.source_encoding);
2303 (const char *)ec->last_error.error_bytes_start,
2304 ec->last_error.error_bytes_len,
2305 rb_enc_find(ec->last_error.source_encoding));
3629 * +primitive_errinfo+ and +last_error+ methods returns the detail of the error.
3632 * +primitive_errinfo+ and +last_error+ methods returns the detail of the error.
3634 * +primitive_errinfo+ and +last_error+ methods returns the detail of the error.
3970 rb_ary_store(ary, 0, econv_result_to_symbol(ec->last_error.result));
3973 if (ec->last_error.source_encoding)
3974 rb_ary_store(ary, 1, rb_str_new2(ec->last_error.source_encoding));
3976 if (ec->last_error.destination_encoding)
3977 rb_ary_store(ary, 2, rb_str_new2(ec->last_error.destination_encoding));
3979 if (ec->last_error.error_bytes_start) {
3980 rb_ary_store(ary, 3, rb_str_new((const char *)ec->last_error.error_bytes_start, ec->last_error.error_bytes_len));
3981 rb_ary_store(ary, 4, rb_str_new((const char *)ec->last_error.error_bytes_start + ec->last_error.error_bytes_len, ec->last_error.readagain_len));
4095 * ec.last_error -> exception or nil
4108 * p ec.last_error #=> #<Encoding::InvalidByteSequenceError: "\xF1" followed by "a" on UTF-8>
4110 * p ec.last_error #=> nil
4428 rb_define_method(rb_cEncodingConverter, "last_error", econv_last_error, 0);