ruby-changes:55651
From: Nobuyoshi <ko1@a...>
Date: Fri, 3 May 2019 21:53:01 +0900 (JST)
Subject: [ruby-changes:55651] Nobuyoshi Nakada: 5776ae3475 (trunk): UTF-8 is one of byte based encodings
https://git.ruby-lang.org/ruby.git/commit/?id=5776ae3475 From 5776ae347540ac19c40d146a3566a806cd176bf1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 3 May 2019 15:33:59 +0900 Subject: UTF-8 is one of byte based encodings diff --git a/string.c b/string.c index b8ff2dd..2febe52 100644 --- a/string.c +++ b/string.c @@ -6600,7 +6600,7 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L6600 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) https://github.com/ruby/ruby/blob/trunk/string.c#L6666 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); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/