diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 09:12:56 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 09:12:56 +0000 |
commit | 131e194cec5a36ac18d6c9abcae6aad6ccd5fd1d (patch) | |
tree | 46cafdd93d913930e75e194e7f43b8b207248243 /include/ruby/encoding.h | |
parent | d6d2eed78ef765f321b33ebdd2bdd9901dd5a39f (diff) | |
download | ruby-131e194cec5a36ac18d6c9abcae6aad6ccd5fd1d.tar.gz |
* include/ruby/encoding.h (rb_econv_t): new field: last_error.
* transcode.c (rb_trans_conv): new argument: result_position_ptr.
(rb_econv_convert): fill last_error.
(econv_result_to_symbol): extracted from econv_primitive_convert.
(econv_primitive_errinfo): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/encoding.h')
-rw-r--r-- | include/ruby/encoding.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index d7ad0d0237..675bd5d90d 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -224,6 +224,17 @@ typedef struct { int num_finished; struct rb_transcoding *last_tc; + /* last error */ + struct { + rb_econv_result_t result; + const char *source_encoding; + const char *destination_encoding; + const unsigned char *error_bytes_start; + size_t error_bytes_len; + size_t readagain_len; + int partial_input; + } last_error; + /* The following fields are only for Encoding::Converter. * rb_econv_open set them NULL. */ rb_encoding *source_encoding; |