summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-15 11:02:07 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-15 11:02:07 +0000
commitfe091e89b73c62fd3940ff4ca9214e3935de257c (patch)
tree5c08feda2ba030b5dcc2c9eaa2ddfc17ccc0e731 /include
parenta98587c0fdfc2536e94b320bf4c1b06c6628df03 (diff)
* 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
Diffstat (limited to 'include')
-rw-r--r--include/ruby/encoding.h5
1 files changed, 4 insertions, 1 deletions
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 */