Merge pull request #24304 from IngmarStein/tar-utf8-locale

Extract tarballs with a UTF-8 locale
This commit is contained in:
Mike McQuaid authored and GitHub committed 2026-10-20 07:49:19 +00:00
commit e77600cfdf
2 files changed
+6 -5

No files matched your search

@@ -62,8 +62,8 @@ RSpec.describe UnpackStrategy::Tar do
}
end
it "uses a stable locale for tar diagnostics" do
expect(strategy).to receive(:system_command!).with("tar", hash_including(env: { "LC_ALL" => "C" }))
it "uses a UTF-8 locale for tar so non-ASCII paths can be extracted" do
expect(strategy).to receive(:system_command!).with("tar", hash_including(env: { "LC_ALL" => "en_US.UTF-8" }))
strategy.extract(to: unpack_dir)
end
+4 -3
View File
@@ -52,9 +52,10 @@ module UnpackStrategy
args: ["--extract", "--no-same-owner",
"--file", tar_path,
"--directory", unpack_dir],
# Keep tar diagnostics in English so that out of space error handle in
# `‎unpack_strategy.rb` can recognize out-of-space errors.
env: { "LC_ALL" => "C" },
# Keep tar diagnostics in English so that `unpack_strategy.rb` can
# recognize out-of-space errors, while using a UTF-8 character set so
# that archives containing non-ASCII paths can be extracted.
env: { "LC_ALL" => "en_US.UTF-8" },
verbose:
end
end