mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/encoding.h (rb_isascii): defined.
(rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/st.h (st_strcasecmp): declared. (st_strncasecmp): ditto. * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp. (st_strcasecmp): defined. (st_strncasecmp): ditto. * include/ruby/ruby.h: include include/ruby/encoding.h. (ISASCII): use rb_isascii. (ISPRINT): use rb_isprint. (ISSPACE): use rb_isspace. (ISUPPER): use rb_isupper. (ISLOWER): use rb_islower. (ISALNUM): use rb_isalnum. (ISALPHA): use rb_isalpha. (ISDIGIT): use rb_isdigit. (ISXDIGIT): use rb_isxdigit. (TOUPPER): defined. (TOLOWER): ditto. (STRCASECMP): ditto. (STRNCASECMP): ditto. * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c, transcode.c, ext/readline/readline.c: use locale insensitive functions. [ruby-core:14662] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
46933426b0
commit
041e829127
14 changed files with 152 additions and 39 deletions
|
@ -110,7 +110,7 @@ init_transcoder_table(void)
|
|||
rb_declare_transcoder("ISO-2022-JP", "UTF-8", "japanese");
|
||||
}
|
||||
|
||||
#define encoding_equal(enc1, enc2) (strcasecmp(enc1, enc2) == 0)
|
||||
#define encoding_equal(enc1, enc2) (STRCASECMP(enc1, enc2) == 0)
|
||||
|
||||
static rb_transcoder *
|
||||
transcode_dispatch(const char* from_encoding, const char* to_encoding)
|
||||
|
@ -297,7 +297,7 @@ str_transcode(int argc, VALUE *argv, VALUE *self)
|
|||
return to_encidx;
|
||||
}
|
||||
}
|
||||
if (strcasecmp(from_e, to_e) == 0) {
|
||||
if (STRCASECMP(from_e, to_e) == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue