Project

General

Profile

Actions

Bug #19902

closed

strftimeの返り値のascii_only?が間違っていることがある

Added by znz (Kazuhiro NISHIYAMA) about 1 year ago. Updated about 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [aarch64-linux]
[ruby-dev:52045]

Description

ruby-jp slack で tompng さんの調査によると以下のように Regexp.esacpe が変になる原因は t.ascii_only? #=> true になっていることでした。

irb(main):053> t = Time.now.strftime(u='あ')
=> "あ"
irb(main):054> t==u
=> true
irb(main):055> t.encoding==u.encoding
=> true
irb(main):056> Regexp.escape(t)
=> "\xE3\x81\x82"
irb(main):057> Regexp.escape(u)
=> "あ"

git bisect で make miniruby && ./miniruby -ve "p Time.now.strftime('%Y年').ascii_only?" をしつつ調べてみると、https://github.com/ruby/ruby/commit/f34280ec6b684eeb21ef3336c7002e1a83dcfd2c から true になってしまっているようです。

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 1 year ago

  • Status changed from Open to Closed

Applied in changeset git|6b66b5fdedb2c9a9ee48e290d57ca7f8d55e01a2.


[Bug #19902] Update the coderange regarding the changed region

Updated by ima1zumi (Mari Imaizumi) about 1 year ago

3.2にバックポートが必要そうです。

Actions #4

Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago

  • Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago

  • Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: REQUIRED to 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: DONE

ruby_3_2 ddbab4f837460f070942e8127de9a9f1b9868fff merged revision(s) 6b66b5fdedb2c9a9ee48e290d57ca7f8d55e01a2.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0