summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-22 05:25:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-22 05:25:15 +0000
commit33356ff75b3c33f85aa21707e2e23bcba0fe7c17 (patch)
treeceaad205d8f62460a2ad1037e6ee6a047bc2c47b /time.c
parent3002e5e1f9767e914ccd3e1fcfd96b38b1fd438f (diff)
* time.c (time_zone): use rb_locale_str_new_cstr to set encoding
as locale and convert its content to internal encoding. [ruby-core:33278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/time.c b/time.c
index bd9ca1b7ba..5ed11c6cee 100644
--- a/time.c
+++ b/time.c
@@ -4189,11 +4189,11 @@ time_zone(VALUE time)
MAKE_TM(time, tobj);
if (TIME_UTC_P(tobj)) {
- return rb_str_new2("UTC");
+ return rb_obj_untaint(rb_locale_str_new_cstr("UTC"));
}
if (tobj->vtm.zone == NULL)
return Qnil;
- return rb_str_new2(tobj->vtm.zone);
+ return rb_obj_untaint(rb_locale_str_new_cstr(tobj->vtm.zone));
}
/*