diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-18 10:36:20 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-18 10:36:20 +0000 |
commit | 3f0ec8887f3bc75a98fd3ec8926518b635c70b7b (patch) | |
tree | cd0f721ca0e03ccec39353962869b9a6e8477c93 /include/ruby/encoding.h | |
parent | 88aa8632741d027d1d2e58f8073d4ec90845499d (diff) | |
download | ruby-3f0ec8887f3bc75a98fd3ec8926518b635c70b7b.tar.gz |
* string.c (rb_external_str_new): a new function to convert from
external encoding to internal encoding. if something went
wrong, it returns a string with the external encoding.
* string.c (rb_external_str_new_with_enc): same as above besides
you can specify the source encoding.
* ruby.c (ruby_set_argv): use rb_external_str_new()
* ruby.c (set_arg0, ruby_script): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/encoding.h')
-rw-r--r-- | include/ruby/encoding.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index 9049df3fa2..1b1cf33d58 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -92,6 +92,8 @@ char* rb_enc_nth(const char*, const char*, int, rb_encoding*); VALUE rb_obj_encoding(VALUE); VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc); +VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *enc); + /* index -> rb_encoding */ rb_encoding* rb_enc_from_index(int idx); |