1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Revert "UTF-8 is one of byte based encodings"

This reverts commit 5776ae3475.

Mistaken `max` as `min`.
This commit is contained in:
Nobuyoshi Nakada 2019-05-06 11:02:12 +09:00
parent 594a033ff0
commit f1b0db2c70
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -6461,7 +6461,7 @@ check_case_options(int argc, VALUE *argv, OnigCaseFoldType flags)
static inline bool
case_option_single_p(OnigCaseFoldType flags, rb_encoding *enc, VALUE str)
{
if ((flags & ONIGENC_CASE_ASCII_ONLY) && (rb_enc_mbmaxlen(enc) == 1))
if ((flags & ONIGENC_CASE_ASCII_ONLY) && (enc==rb_utf8_encoding() || rb_enc_mbmaxlen(enc) == 1))
return true;
return !(flags & ONIGENC_CASE_FOLD_TURKISH_AZERI) && ENC_CODERANGE(str) == ENC_CODERANGE_7BIT;
}