Skip to content

[GR-18163] Fix locale docs for Oracle Linux and fix test when run in Docker #3909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# https://github.com/google/jsonnet/releases and compiled.

# CONFIGURATION
local overlay = "86462312c58551adf8993c7fbced4963751230d3";
local overlay = "6f30aacf41a0c15262f890770972e3f74af187e7";

# For debugging: generated builds will be restricted to those listed in
# the array. No restriction is applied when it is empty.
Expand Down
1 change: 1 addition & 0 deletions doc/user/utf8-locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Instead, all values should be `"en_US.UTF-8"` or other regions but still `.UTF-8
### Fedora-based: RHEL, Oracle Linux, etc

```bash
sudo dnf install glibc-langpack-en
export LANG=en_US.UTF-8
```

Expand Down
10 changes: 6 additions & 4 deletions spec/truffle/include_all_c_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

describe 'lib/cext/include/internal_all.h' do
it 'includes each *.h file from lib/cext/include/internal/' do
filenames = Dir.glob('internal/**/*.h', base: 'lib/cext/include', sort: true)
content = File.read('lib/cext/include/internal_all.h')
ruby_home = RbConfig::CONFIG['prefix']
filenames = Dir.glob('internal/**/*.h', base: "#{ruby_home}/lib/cext/include", sort: true)
content = File.read("#{ruby_home}/lib/cext/include/internal_all.h")

filenames.should_not be_empty

Expand All @@ -20,8 +21,9 @@
end

it 'includes each *.h file from lib/cext/include/stubs/internal/' do
filenames = Dir.glob('internal/**/*.h', base: 'lib/cext/include/stubs', sort: true)
content = File.read('lib/cext/include/internal_all.h')
ruby_home = RbConfig::CONFIG['prefix']
filenames = Dir.glob('internal/**/*.h', base: "#{ruby_home}/lib/cext/include/stubs", sort: true)
content = File.read("#{ruby_home}/lib/cext/include/internal_all.h")

filenames.should_not be_empty

Expand Down
2 changes: 1 addition & 1 deletion src/main/ruby/truffleruby/core/dir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def glob(pattern, flags = 0, base: nil, sort: true, &block)

total = matches.size
while index < total
matches[index] = matches[index].encode(enc) unless matches[index].encoding == enc
matches[index] = matches[index].force_encoding(enc) unless matches[index].encoding == enc
index += 1
end
end
Expand Down
6 changes: 5 additions & 1 deletion src/main/ruby/truffleruby/core/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,11 @@ def set_encoding(value)
if Encoding.default_internal && value.ascii_only?
value = value.encode Encoding.default_internal, Encoding::LOCALE
elsif value.encoding != Encoding::LOCALE
value = value.dup.force_encoding(Encoding::LOCALE)
if Encoding::LOCALE == Encoding::US_ASCII && !value.ascii_only?
value = value.b
else
value = value.dup.force_encoding(Encoding::LOCALE)
end
end
value.freeze
end
Expand Down
Loading