From fe091e89b73c62fd3940ff4ca9214e3935de257c Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 15 Aug 2008 11:02:07 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/ruby/encoding.h') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index e4259845e8..008d5f953f 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 */ -- cgit v1.2.3