diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-22 05:25:15 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-22 05:25:15 +0000 |
commit | 33356ff75b3c33f85aa21707e2e23bcba0fe7c17 (patch) | |
tree | ceaad205d8f62460a2ad1037e6ee6a047bc2c47b /time.c | |
parent | 3002e5e1f9767e914ccd3e1fcfd96b38b1fd438f (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); } /* |