mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
UTF-8 is one of byte based encodings
This commit is contained in:
parent
58cd4b7bde
commit
5776ae3475
1 changed files with 2 additions and 2 deletions
4
string.c
4
string.c
|
@ -6600,7 +6600,7 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str)
|
|||
str_modify_keep_cr(str);
|
||||
enc = STR_ENC_GET(str);
|
||||
rb_str_check_dummy_enc(enc);
|
||||
if (((flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1))
|
||||
if (((flags&ONIGENC_CASE_ASCII_ONLY) && (rb_enc_mbmaxlen(enc)==1))
|
||||
|| (!(flags&ONIGENC_CASE_FOLD_TURKISH_AZERI) && ENC_CODERANGE(str)==ENC_CODERANGE_7BIT)) {
|
||||
char *s = RSTRING_PTR(str), *send = RSTRING_END(str);
|
||||
|
||||
|
@ -6666,7 +6666,7 @@ rb_str_downcase_bang(int argc, VALUE *argv, VALUE str)
|
|||
str_modify_keep_cr(str);
|
||||
enc = STR_ENC_GET(str);
|
||||
rb_str_check_dummy_enc(enc);
|
||||
if (((flags&ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc)==1))
|
||||
if (((flags&ONIGENC_CASE_ASCII_ONLY) && (rb_enc_mbmaxlen(enc)==1))
|
||||
|| (!(flags&ONIGENC_CASE_FOLD_TURKISH_AZERI) && ENC_CODERANGE(str)==ENC_CODERANGE_7BIT)) {
|
||||
char *s = RSTRING_PTR(str), *send = RSTRING_END(str);
|
||||
|
||||
|
|
Loading…
Reference in a new issue