summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-18 10:36:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-18 10:36:20 +0000
commit3f0ec8887f3bc75a98fd3ec8926518b635c70b7b (patch)
treecd0f721ca0e03ccec39353962869b9a6e8477c93 /include
parent88aa8632741d027d1d2e58f8073d4ec90845499d (diff)
* 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')
-rw-r--r--include/ruby/encoding.h2
-rw-r--r--include/ruby/intern.h1
2 files changed, 3 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);
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index d99c39636b..8e38217aac 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -546,6 +546,7 @@ VALUE rb_str_new5(VALUE, const char*, long);
VALUE rb_tainted_str_new_cstr(const char*);
VALUE rb_tainted_str_new(const char*, long);
VALUE rb_tainted_str_new2(const char*);
+VALUE rb_external_str_new(const char*, long);
VALUE rb_str_buf_new(long);
VALUE rb_str_buf_new_cstr(const char*);
VALUE rb_str_buf_new2(const char*);