diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-20 07:15:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-20 07:15:19 +0000 |
commit | 7a19c1b34db6e47acfdcc7391f336b33718b5d58 (patch) | |
tree | 4870284e9b3533ede6249c364151f15dc7b704e5 | |
parent | 4490590ba5303889dc56e8635c23732026eb52ab (diff) | |
download | ruby-7a19c1b34db6e47acfdcc7391f336b33718b5d58.tar.gz ruby-7a19c1b34db6e47acfdcc7391f336b33718b5d58.tar.xz ruby-7a19c1b34db6e47acfdcc7391f336b33718b5d58.zip |
* string.c (rb_locale_str_new): new function to convert string
from locale to internal encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | include/ruby/intern.h | 1 | ||||
-rw-r--r-- | string.c | 6 |
3 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Mon Oct 20 15:42:02 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * string.c (rb_locale_str_new): new function to convert string + from locale to internal encoding. + Mon Oct 20 09:47:13 2008 Tanaka Akira <akr@fsij.org> * test/runner.rb: search srcdir/test/arg at first to find test/ruby diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 8e38217aa..6472ee8ce 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -547,6 +547,7 @@ 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_locale_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*); @@ -526,6 +526,12 @@ rb_external_str_new(const char *ptr, long len) return rb_external_str_new_with_enc(ptr, len, rb_default_external_encoding()); } +VALUE +rb_locale_str_new(const char *ptr, long len) +{ + return rb_external_str_new_with_enc(ptr, len, rb_locale_encoding()); +} + static VALUE str_replace_shared(VALUE str2, VALUE str) { |