diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 11:02:07 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-15 11:02:07 +0000 |
commit | 0dfb27fb69155921214181c1e8e4070e7bf5705c (patch) | |
tree | 5c08feda2ba030b5dcc2c9eaa2ddfc17ccc0e731 /include/ruby/encoding.h | |
parent | b516a20d71e175b8af8ae076cbf0303243210b66 (diff) | |
download | ruby-0dfb27fb69155921214181c1e8e4070e7bf5705c.tar.gz ruby-0dfb27fb69155921214181c1e8e4070e7bf5705c.tar.xz ruby-0dfb27fb69155921214181c1e8e4070e7bf5705c.zip |
* include/ruby/encoding.h (rb_econv_output): add str_encoding
argument.
* transcode.c (get_replacement_character): add repl_enc_ptr argument.
(rb_econv_output_with_destination_encoding): renamed from
rb_econv_output and make it static.
(rb_econv_output): convert str and call
rb_econv_output_with_destination_encoding.
(output_replacement_character): follow above interface change.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/encoding.h')
-rw-r--r-- | include/ruby/encoding.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index e4259845e..008d5f953 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -247,10 +247,13 @@ rb_econv_result_t rb_econv_convert(rb_econv_t *ec, const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, int flags); + +/* result: 0:success -1:failure -2:conversion-failure-to-destination-encoding */ int rb_econv_output(rb_econv_t *ec, - const unsigned char *str, size_t len, + const unsigned char *str, size_t len, const char *str_encoding, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, size_t *required_size); + void rb_econv_close(rb_econv_t *ec); /* flags for rb_econv_open */ |