From: nobu@... Date: 2021-01-13T15:19:32+00:00 Subject: [ruby-core:102062] [Ruby master Bug#17517] File.expand_path returns us-ascii when both arguments are ascii compat Issue #17517 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/4061 ---------------------------------------- Bug #17517: File.expand_path returns us-ascii when both arguments are ascii compat https://bugs.ruby-lang.org/issues/17517#change-89923 * Author: znz (Kazuhiro NISHIYAMA) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Is this intentional? ```ruby p __dir__.encoding #=> # p 'hoge'.encoding #=> # p File.expand_path('hoge', __dir__).encoding #=> # ``` ``` % docker run -it --rm ghcr.io/ruby/all-ruby env ALL_RUBY_SINCE=ruby-1.9 ./all-ruby -e 'p File.expand_path("hoge".encode("utf-8"), "/".encode("utf-8")).encoding' ruby-1.9.0-0 -e:1:in `encode': transcoding not supported (from ASCII-8BIT to UTF-8) (ArgumentError) from -e:1:in `
' exit 1 ruby-1.9.0-1 # ruby-1.9.0-2 # ... ruby-1.9.1-p129 # ruby-1.9.1-p243 # ... ruby-1.9.2-preview1 # ruby-1.9.2-preview3 # ... ruby-3.0.0 # ``` -- https://bugs.ruby-lang.org/ Unsubscribe: