diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-27 09:18:18 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-27 09:18:18 +0000 |
commit | 23b280869314c59be4e4fb01d68ebacf753475a9 (patch) | |
tree | 67b49fe3fb2ce6a9e4d6faee0da10fb003f9c6ca /internal.h | |
parent | 4d033a11c5bd778f124febb30e419bd91d372076 (diff) |
* strftime.c (rb_strftime_with_timespec): get enc argument to specify
the encoding of the format. On Windows (at least Japanese Windows),
Time#strftime("%Z") includes non ASCII in locale encoding (CP932).
So convert locale to default internal. [ruby-core:39092] [Bug #5226]
* strftime.c (rb_strftime): ditto.
* strftime.c (rb_strftime_timespec): ditto.
* internal.h (rb_strftime_timespec): follow above.
* time.c (rb_strftime_alloc): ditto.
* time.c (strftimev): ditto.
* time.c (time_strftime): ditto.
* time.c (time_to_s): the resulted string of Time#to_s is always
ascii only, so this should be US-ASCII.
* time.c (time_asctime): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal.h b/internal.h index dad96606db..6e5773548e 100644 --- a/internal.h +++ b/internal.h @@ -29,6 +29,8 @@ struct rb_classext_struct { struct st_table *const_tbl; }; +typedef struct OnigEncodingTypeST rb_encoding; + #undef RCLASS_SUPER #define RCLASS_EXT(c) (RCLASS(c)->ptr) #define RCLASS_SUPER(c) (RCLASS_EXT(c)->super) @@ -158,7 +160,7 @@ VALUE rb_reg_check_preprocess(VALUE); int rb_get_next_signal(void); /* strftime.c */ -size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt); +size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc, const struct vtm *vtm, struct timespec *ts, int gmt); /* string.c */ int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p); |